Mercurial > kallithea
comparison rhodecode/tests/functional/test_compare_local.py @ 3023:c2a206162062 beta
Basic implementation of cherry picking changesets
for pull request, ref #575
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 24 Nov 2012 00:29:38 +0100 |
parents | |
children | ed11764eb81a |
comparison
equal
deleted
inserted
replaced
3022:0ed42ca7ff9e | 3023:c2a206162062 |
---|---|
1 from rhodecode.tests import * | |
2 from rhodecode.model.repo import RepoModel | |
3 from rhodecode.model.meta import Session | |
4 from rhodecode.model.db import Repository | |
5 from rhodecode.model.scm import ScmModel | |
6 from rhodecode.lib.vcs.backends.base import EmptyChangeset | |
7 | |
8 | |
9 class TestCompareController(TestController): | |
10 | |
11 def test_compare_tag_hg(self): | |
12 self.log_user() | |
13 tag1 = '0.1.2' | |
14 tag2 = '0.1.3' | |
15 response = self.app.get(url(controller='compare', action='index', | |
16 repo_name=HG_REPO, | |
17 org_ref_type="tag", | |
18 org_ref=tag1, | |
19 other_ref_type="tag", | |
20 other_ref=tag2, | |
21 )) | |
22 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, tag1, HG_REPO, tag2)) | |
23 ## outgoing changesets between tags | |
24 response.mustcontain('''<a href="/%s/changeset/c5ddebc06eaaba3010c2d66ea6ec9d074eb0f678">r112:c5ddebc06eaa</a>''' % HG_REPO) | |
25 response.mustcontain('''<a href="/%s/changeset/70d4cef8a37657ee4cf5aabb3bd9f68879769816">r115:70d4cef8a376</a>''' % HG_REPO) | |
26 response.mustcontain('''<a href="/%s/changeset/9749bfbfc0d2eba208d7947de266303b67c87cda">r116:9749bfbfc0d2</a>''' % HG_REPO) | |
27 response.mustcontain('''<a href="/%s/changeset/41fda979f02fda216374bf8edac4e83f69e7581c">r117:41fda979f02f</a>''' % HG_REPO) | |
28 response.mustcontain('''<a href="/%s/changeset/bb1a3ab98cc45cb934a77dcabf87a5a598b59e97">r118:bb1a3ab98cc4</a>''' % HG_REPO) | |
29 response.mustcontain('''<a href="/%s/changeset/36e0fc9d2808c5022a24f49d6658330383ed8666">r119:36e0fc9d2808</a>''' % HG_REPO) | |
30 response.mustcontain('''<a href="/%s/changeset/17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">r120:17544fbfcd33</a>''' % HG_REPO) | |
31 | |
32 response.mustcontain('11 files changed with 94 insertions and 64 deletions') | |
33 | |
34 ## files diff | |
35 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--1c5cf9e91c12">docs/api/utils/index.rst</a></div>''' % (HG_REPO, tag1, tag2)) | |
36 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--e3305437df55">test_and_report.sh</a></div>''' % (HG_REPO, tag1, tag2)) | |
37 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--c8e92ef85cd1">.hgignore</a></div>''' % (HG_REPO, tag1, tag2)) | |
38 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--6e08b694d687">.hgtags</a></div>''' % (HG_REPO, tag1, tag2)) | |
39 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--2c14b00f3393">docs/api/index.rst</a></div>''' % (HG_REPO, tag1, tag2)) | |
40 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--430ccbc82bdf">vcs/__init__.py</a></div>''' % (HG_REPO, tag1, tag2)) | |
41 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--9c390eb52cd6">vcs/backends/hg.py</a></div>''' % (HG_REPO, tag1, tag2)) | |
42 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--ebb592c595c0">vcs/utils/__init__.py</a></div>''' % (HG_REPO, tag1, tag2)) | |
43 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--7abc741b5052">vcs/utils/annotate.py</a></div>''' % (HG_REPO, tag1, tag2)) | |
44 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--2ef0ef106c56">vcs/utils/diffs.py</a></div>''' % (HG_REPO, tag1, tag2)) | |
45 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--3150cb87d4b7">vcs/utils/lazy.py</a></div>''' % (HG_REPO, tag1, tag2)) | |
46 | |
47 def test_compare_tag_git(self): | |
48 self.log_user() | |
49 tag1 = 'v0.1.2' | |
50 tag2 = 'v0.1.3' | |
51 response = self.app.get(url(controller='compare', action='index', | |
52 repo_name=GIT_REPO, | |
53 org_ref_type="tag", | |
54 org_ref=tag1, | |
55 other_ref_type="tag", | |
56 other_ref=tag2, | |
57 bundle=False | |
58 )) | |
59 response.mustcontain('%s@%s -> %s@%s' % (GIT_REPO, tag1, GIT_REPO, tag2)) | |
60 | |
61 ## outgoing changesets between tags | |
62 response.mustcontain('''<a href="/%s/changeset/794bbdd31545c199f74912709ea350dedcd189a2">r113:794bbdd31545</a>''' % GIT_REPO) | |
63 response.mustcontain('''<a href="/%s/changeset/e36d8c5025329bdd4212bd53d4ed8a70ff44985f">r115:e36d8c502532</a>''' % GIT_REPO) | |
64 response.mustcontain('''<a href="/%s/changeset/5c9ff4f6d7508db0e72b1d2991c357d0d8e07af2">r116:5c9ff4f6d750</a>''' % GIT_REPO) | |
65 response.mustcontain('''<a href="/%s/changeset/b7187fa2b8c1d773ec35e9dee12f01f74808c879">r117:b7187fa2b8c1</a>''' % GIT_REPO) | |
66 response.mustcontain('''<a href="/%s/changeset/5f3b74262014a8de2dc7dade1152de9fd0c8efef">r118:5f3b74262014</a>''' % GIT_REPO) | |
67 response.mustcontain('''<a href="/%s/changeset/17438a11f72b93f56d0e08e7d1fa79a378578a82">r119:17438a11f72b</a>''' % GIT_REPO) | |
68 response.mustcontain('''<a href="/%s/changeset/5a3a8fb005554692b16e21dee62bf02667d8dc3e">r120:5a3a8fb00555</a>''' % GIT_REPO) | |
69 | |
70 response.mustcontain('11 files changed with 94 insertions and 64 deletions') | |
71 | |
72 #files | |
73 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--1c5cf9e91c12">docs/api/utils/index.rst</a>''' % (GIT_REPO, tag1, tag2)) | |
74 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--e3305437df55">test_and_report.sh</a>''' % (GIT_REPO, tag1, tag2)) | |
75 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--c8e92ef85cd1">.hgignore</a>''' % (GIT_REPO, tag1, tag2)) | |
76 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--6e08b694d687">.hgtags</a>''' % (GIT_REPO, tag1, tag2)) | |
77 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--2c14b00f3393">docs/api/index.rst</a>''' % (GIT_REPO, tag1, tag2)) | |
78 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--430ccbc82bdf">vcs/__init__.py</a>''' % (GIT_REPO, tag1, tag2)) | |
79 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>''' % (GIT_REPO, tag1, tag2)) | |
80 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--ebb592c595c0">vcs/utils/__init__.py</a>''' % (GIT_REPO, tag1, tag2)) | |
81 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--7abc741b5052">vcs/utils/annotate.py</a>''' % (GIT_REPO, tag1, tag2)) | |
82 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--2ef0ef106c56">vcs/utils/diffs.py</a>''' % (GIT_REPO, tag1, tag2)) | |
83 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--3150cb87d4b7">vcs/utils/lazy.py</a>''' % (GIT_REPO, tag1, tag2)) | |
84 | |
85 def test_index_branch_hg(self): | |
86 self.log_user() | |
87 response = self.app.get(url(controller='compare', action='index', | |
88 repo_name=HG_REPO, | |
89 org_ref_type="branch", | |
90 org_ref='default', | |
91 other_ref_type="branch", | |
92 other_ref='default', | |
93 )) | |
94 | |
95 response.mustcontain('%s@default -> %s@default' % (HG_REPO, HG_REPO)) | |
96 # branch are equal | |
97 response.mustcontain('<span class="empty_data">No files</span>') | |
98 response.mustcontain('<span class="empty_data">No changesets</span>') | |
99 | |
100 def test_index_branch_git(self): | |
101 self.log_user() | |
102 response = self.app.get(url(controller='compare', action='index', | |
103 repo_name=GIT_REPO, | |
104 org_ref_type="branch", | |
105 org_ref='master', | |
106 other_ref_type="branch", | |
107 other_ref='master', | |
108 )) | |
109 | |
110 response.mustcontain('%s@master -> %s@master' % (GIT_REPO, GIT_REPO)) | |
111 # branch are equal | |
112 response.mustcontain('<span class="empty_data">No files</span>') | |
113 response.mustcontain('<span class="empty_data">No changesets</span>') | |
114 | |
115 def test_compare_revisions_hg(self): | |
116 self.log_user() | |
117 rev1 = 'b986218ba1c9' | |
118 rev2 = '3d8f361e72ab' | |
119 | |
120 response = self.app.get(url(controller='compare', action='index', | |
121 repo_name=HG_REPO, | |
122 org_ref_type="rev", | |
123 org_ref=rev1, | |
124 other_ref_type="rev", | |
125 other_ref=rev2, | |
126 )) | |
127 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_REPO, rev2)) | |
128 ## outgoing changesets between those revisions | |
129 response.mustcontain("""<a href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (HG_REPO, rev2)) | |
130 | |
131 response.mustcontain('1 file changed with 7 insertions and 0 deletions') | |
132 ## files | |
133 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--c8e92ef85cd1">.hgignore</a>""" % (HG_REPO, rev1, rev2)) | |
134 | |
135 def test_compare_revisions_git(self): | |
136 self.log_user() | |
137 rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3' | |
138 rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557' | |
139 | |
140 response = self.app.get(url(controller='compare', action='index', | |
141 repo_name=GIT_REPO, | |
142 org_ref_type="rev", | |
143 org_ref=rev1, | |
144 other_ref_type="rev", | |
145 other_ref=rev2, | |
146 )) | |
147 response.mustcontain('%s@%s -> %s@%s' % (GIT_REPO, rev1, GIT_REPO, rev2)) | |
148 ## outgoing changesets between those revisions | |
149 response.mustcontain("""<a href="/%s/changeset/38b5fe81f109cb111f549bfe9bb6b267e10bc557">r1:%s</a>""" % (GIT_REPO, rev2[:12])) | |
150 response.mustcontain('1 file changed with 7 insertions and 0 deletions') | |
151 | |
152 ## files | |
153 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--c8e92ef85cd1">.hgignore</a>""" % (GIT_REPO, rev1, rev2)) |