Mercurial > kallithea
comparison rhodecode/tests/functional/test_compare.py @ 3015:16af24982e30 beta
Multiple changes for compare system
- count number of changed lines and files
- add combined compare button into the old per changeset compare
- fixed some logic for remote & bundle compare system
- added few tests for git compare
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 18 Nov 2012 23:17:02 +0100 |
parents | 0b86972de820 |
children | c2a206162062 |
comparison
equal
deleted
inserted
replaced
3014:02bbd574fa14 | 3015:16af24982e30 |
---|---|
6 from rhodecode.lib.vcs.backends.base import EmptyChangeset | 6 from rhodecode.lib.vcs.backends.base import EmptyChangeset |
7 | 7 |
8 | 8 |
9 class TestCompareController(TestController): | 9 class TestCompareController(TestController): |
10 | 10 |
11 def test_index_tag(self): | 11 def test_compare_tag_hg(self): |
12 self.log_user() | 12 self.log_user() |
13 tag1 = '0.1.3' | 13 tag1 = '0.1.2' |
14 tag2 = '0.1.2' | 14 tag2 = '0.1.3' |
15 response = self.app.get(url(controller='compare', action='index', | 15 response = self.app.get(url(controller='compare', action='index', |
16 repo_name=HG_REPO, | 16 repo_name=HG_REPO, |
17 org_ref_type="tag", | 17 org_ref_type="tag", |
18 org_ref=tag1, | 18 org_ref=tag1, |
19 other_ref_type="tag", | 19 other_ref_type="tag", |
20 other_ref=tag2, | 20 other_ref=tag2, |
21 )) | 21 )) |
22 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, tag1, HG_REPO, tag2)) | 22 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, tag1, HG_REPO, tag2)) |
23 ## outgoing changesets between tags | 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) | |
24 response.mustcontain('''<a href="/%s/changeset/17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">r120:17544fbfcd33</a>''' % HG_REPO) | 30 response.mustcontain('''<a href="/%s/changeset/17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">r120:17544fbfcd33</a>''' % HG_REPO) |
25 response.mustcontain('''<a href="/%s/changeset/36e0fc9d2808c5022a24f49d6658330383ed8666">r119:36e0fc9d2808</a>''' % HG_REPO) | |
26 response.mustcontain('''<a href="/%s/changeset/bb1a3ab98cc45cb934a77dcabf87a5a598b59e97">r118:bb1a3ab98cc4</a>''' % HG_REPO) | |
27 response.mustcontain('''<a href="/%s/changeset/41fda979f02fda216374bf8edac4e83f69e7581c">r117:41fda979f02f</a>''' % HG_REPO) | |
28 response.mustcontain('''<a href="/%s/changeset/9749bfbfc0d2eba208d7947de266303b67c87cda">r116:9749bfbfc0d2</a>''' % HG_REPO) | |
29 response.mustcontain('''<a href="/%s/changeset/70d4cef8a37657ee4cf5aabb3bd9f68879769816">r115:70d4cef8a376</a>''' % HG_REPO) | |
30 response.mustcontain('''<a href="/%s/changeset/c5ddebc06eaaba3010c2d66ea6ec9d074eb0f678">r112:c5ddebc06eaa</a>''' % HG_REPO) | |
31 | 31 |
32 ## files diff | 32 ## files diff |
33 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)) | 33 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)) |
34 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)) | 34 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)) |
35 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--c8e92ef85cd1">.hgignore</a></div>''' % (HG_REPO, tag1, tag2)) | 35 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--c8e92ef85cd1">.hgignore</a></div>''' % (HG_REPO, tag1, tag2)) |
40 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)) | 40 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)) |
41 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)) | 41 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)) |
42 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)) | 42 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)) |
43 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)) | 43 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)) |
44 | 44 |
45 def test_index_branch(self): | 45 def test_compare_tag_git(self): |
46 self.log_user() | |
47 tag1 = 'v0.1.2' | |
48 tag2 = 'v0.1.3' | |
49 response = self.app.get(url(controller='compare', action='index', | |
50 repo_name=GIT_REPO, | |
51 org_ref_type="tag", | |
52 org_ref=tag1, | |
53 other_ref_type="tag", | |
54 other_ref=tag2, | |
55 bundle=False | |
56 )) | |
57 response.mustcontain('%s@%s -> %s@%s' % (GIT_REPO, tag1, GIT_REPO, tag2)) | |
58 | |
59 ## outgoing changesets between tags | |
60 response.mustcontain('''<a href="/%s/changeset/794bbdd31545c199f74912709ea350dedcd189a2">r113:794bbdd31545</a>''' % GIT_REPO) | |
61 response.mustcontain('''<a href="/%s/changeset/e36d8c5025329bdd4212bd53d4ed8a70ff44985f">r115:e36d8c502532</a>''' % GIT_REPO) | |
62 response.mustcontain('''<a href="/%s/changeset/5c9ff4f6d7508db0e72b1d2991c357d0d8e07af2">r116:5c9ff4f6d750</a>''' % GIT_REPO) | |
63 response.mustcontain('''<a href="/%s/changeset/b7187fa2b8c1d773ec35e9dee12f01f74808c879">r117:b7187fa2b8c1</a>''' % GIT_REPO) | |
64 response.mustcontain('''<a href="/%s/changeset/5f3b74262014a8de2dc7dade1152de9fd0c8efef">r118:5f3b74262014</a>''' % GIT_REPO) | |
65 response.mustcontain('''<a href="/%s/changeset/17438a11f72b93f56d0e08e7d1fa79a378578a82">r119:17438a11f72b</a>''' % GIT_REPO) | |
66 response.mustcontain('''<a href="/%s/changeset/5a3a8fb005554692b16e21dee62bf02667d8dc3e">r120:5a3a8fb00555</a>''' % GIT_REPO) | |
67 | |
68 #files | |
69 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--1c5cf9e91c12">docs/api/utils/index.rst</a>''' % (GIT_REPO, tag1, tag2)) | |
70 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--e3305437df55">test_and_report.sh</a>''' % (GIT_REPO, tag1, tag2)) | |
71 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--c8e92ef85cd1">.hgignore</a>''' % (GIT_REPO, tag1, tag2)) | |
72 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--6e08b694d687">.hgtags</a>''' % (GIT_REPO, tag1, tag2)) | |
73 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--2c14b00f3393">docs/api/index.rst</a>''' % (GIT_REPO, tag1, tag2)) | |
74 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--430ccbc82bdf">vcs/__init__.py</a>''' % (GIT_REPO, tag1, tag2)) | |
75 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>''' % (GIT_REPO, tag1, tag2)) | |
76 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--ebb592c595c0">vcs/utils/__init__.py</a>''' % (GIT_REPO, tag1, tag2)) | |
77 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--7abc741b5052">vcs/utils/annotate.py</a>''' % (GIT_REPO, tag1, tag2)) | |
78 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--2ef0ef106c56">vcs/utils/diffs.py</a>''' % (GIT_REPO, tag1, tag2)) | |
79 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--3150cb87d4b7">vcs/utils/lazy.py</a>''' % (GIT_REPO, tag1, tag2)) | |
80 | |
81 def test_index_branch_hg(self): | |
46 self.log_user() | 82 self.log_user() |
47 response = self.app.get(url(controller='compare', action='index', | 83 response = self.app.get(url(controller='compare', action='index', |
48 repo_name=HG_REPO, | 84 repo_name=HG_REPO, |
49 org_ref_type="branch", | 85 org_ref_type="branch", |
50 org_ref='default', | 86 org_ref='default', |
52 other_ref='default', | 88 other_ref='default', |
53 )) | 89 )) |
54 | 90 |
55 response.mustcontain('%s@default -> %s@default' % (HG_REPO, HG_REPO)) | 91 response.mustcontain('%s@default -> %s@default' % (HG_REPO, HG_REPO)) |
56 # branch are equal | 92 # branch are equal |
57 response.mustcontain('<tr><td>No changesets</td></tr>') | 93 response.mustcontain('<span class="empty_data">No files</span>') |
94 response.mustcontain('<span class="empty_data">No changesets</span>') | |
95 | |
96 def test_index_branch_git(self): | |
97 self.log_user() | |
98 response = self.app.get(url(controller='compare', action='index', | |
99 repo_name=GIT_REPO, | |
100 org_ref_type="branch", | |
101 org_ref='master', | |
102 other_ref_type="branch", | |
103 other_ref='master', | |
104 )) | |
105 | |
106 response.mustcontain('%s@master -> %s@master' % (GIT_REPO, GIT_REPO)) | |
107 # branch are equal | |
108 response.mustcontain('<span class="empty_data">No files</span>') | |
109 response.mustcontain('<span class="empty_data">No changesets</span>') | |
58 | 110 |
59 def test_compare_revisions(self): | 111 def test_compare_revisions(self): |
60 self.log_user() | 112 self.log_user() |
61 rev1 = '3d8f361e72ab' | 113 rev1 = 'b986218ba1c9' |
62 rev2 = 'b986218ba1c9' | 114 rev2 = '3d8f361e72ab' |
115 | |
63 response = self.app.get(url(controller='compare', action='index', | 116 response = self.app.get(url(controller='compare', action='index', |
64 repo_name=HG_REPO, | 117 repo_name=HG_REPO, |
65 org_ref_type="rev", | 118 org_ref_type="rev", |
66 org_ref=rev1, | 119 org_ref=rev1, |
67 other_ref_type="rev", | 120 other_ref_type="rev", |
68 other_ref=rev2, | 121 other_ref=rev2, |
69 )) | 122 )) |
70 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_REPO, rev2)) | 123 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_REPO, rev2)) |
71 ## outgoing changesets between those revisions | 124 ## outgoing changesets between those revisions |
72 response.mustcontain("""<a href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (HG_REPO, rev1)) | 125 response.mustcontain("""<a href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (HG_REPO, rev2)) |
73 | |
74 ## files | 126 ## files |
75 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--c8e92ef85cd1">.hgignore</a>""" % (HG_REPO, rev1, rev2)) | 127 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--c8e92ef85cd1">.hgignore</a>""" % (HG_REPO, rev1, rev2)) |
76 | 128 |
77 def test_compare_remote_repos(self): | 129 def test_compare_remote_repos(self): |
78 self.log_user() | 130 self.log_user() |
91 ) | 143 ) |
92 RepoModel().create_fork(form_data, cur_user=TEST_USER_ADMIN_LOGIN) | 144 RepoModel().create_fork(form_data, cur_user=TEST_USER_ADMIN_LOGIN) |
93 | 145 |
94 Session().commit() | 146 Session().commit() |
95 | 147 |
96 rev1 = '7d4bc8ec6be5' | 148 rev1 = '56349e29c2af' |
97 rev2 = '56349e29c2af' | 149 rev2 = '7d4bc8ec6be5' |
98 | 150 |
99 response = self.app.get(url(controller='compare', action='index', | 151 response = self.app.get(url(controller='compare', action='index', |
100 repo_name=HG_REPO, | 152 repo_name=HG_REPO, |
101 org_ref_type="rev", | 153 org_ref_type="rev", |
102 org_ref=rev1, | 154 org_ref=rev1, |
103 other_ref_type="rev", | 155 other_ref_type="rev", |
104 other_ref=rev2, | 156 other_ref=rev2, |
105 repo=HG_FORK | 157 repo=HG_FORK, |
106 )) | 158 )) |
107 | 159 |
108 try: | 160 try: |
109 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_FORK, rev2)) | 161 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_FORK, rev2)) |
110 ## outgoing changesets between those revisions | 162 ## outgoing changesets between those revisions |
111 | 163 |
112 response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_REPO, rev1)) | 164 response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_REPO)) |
113 response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_REPO)) | 165 response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_REPO)) |
114 response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_REPO)) | 166 response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_REPO, rev2)) |
115 | 167 |
116 ## files | 168 ## files |
117 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2)) | 169 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2)) |
118 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2)) | 170 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2)) |
119 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2)) | 171 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2)) |
120 finally: | 172 finally: |
121 RepoModel().delete(HG_FORK) | 173 RepoModel().delete(HG_FORK) |
122 | 174 |
175 def test_compare_remote_repos_remote_flag_off(self): | |
176 self.log_user() | |
177 | |
178 form_data = dict( | |
179 repo_name=HG_FORK, | |
180 repo_name_full=HG_FORK, | |
181 repo_group=None, | |
182 repo_type='hg', | |
183 description='', | |
184 private=False, | |
185 copy_permissions=False, | |
186 landing_rev='tip', | |
187 update_after_clone=False, | |
188 fork_parent_id=Repository.get_by_repo_name(HG_REPO), | |
189 ) | |
190 RepoModel().create_fork(form_data, cur_user=TEST_USER_ADMIN_LOGIN) | |
191 | |
192 Session().commit() | |
193 | |
194 rev1 = '56349e29c2af' | |
195 rev2 = '7d4bc8ec6be5' | |
196 | |
197 response = self.app.get(url(controller='compare', action='index', | |
198 repo_name=HG_REPO, | |
199 org_ref_type="rev", | |
200 org_ref=rev1, | |
201 other_ref_type="rev", | |
202 other_ref=rev2, | |
203 repo=HG_FORK, | |
204 bundle=False, | |
205 )) | |
206 | |
207 try: | |
208 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_FORK, rev2)) | |
209 ## outgoing changesets between those revisions | |
210 | |
211 response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_REPO)) | |
212 response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_REPO)) | |
213 response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_REPO, rev2)) | |
214 | |
215 ## files | |
216 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2)) | |
217 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2)) | |
218 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2)) | |
219 finally: | |
220 RepoModel().delete(HG_FORK) | |
221 | |
222 # def test_compare_origin_ahead_of_fork(self): | |
223 # self.log_user() | |
224 # | |
225 # form_data = dict( | |
226 # repo_name=HG_FORK, | |
227 # repo_name_full=HG_FORK, | |
228 # repo_group=None, | |
229 # repo_type='hg', | |
230 # description='', | |
231 # private=False, | |
232 # copy_permissions=False, | |
233 # landing_rev='tip', | |
234 # update_after_clone=False, | |
235 # fork_parent_id=Repository.get_by_repo_name(HG_REPO), | |
236 # ) | |
237 # RepoModel().create_fork(form_data, cur_user=TEST_USER_ADMIN_LOGIN) | |
238 # | |
239 # Session().commit() | |
240 # | |
241 # repo1 = Repository.get_by_repo_name(HG_REPO) | |
242 # r1_name = HG_REPO | |
243 # | |
244 # #commit something ! | |
245 # cs0 = ScmModel().create_node( | |
246 # repo=repo1.scm_instance, repo_name=r1_name, | |
247 # cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN, | |
248 # author=TEST_USER_ADMIN_LOGIN, | |
249 # message='extra commit1', | |
250 # content='line1', | |
251 # f_path='file1' | |
252 # ) | |
253 # | |
254 # | |
255 # rev1 = '56349e29c2af' | |
256 # rev2 = '7d4bc8ec6be5' | |
257 # | |
258 # response = self.app.get(url(controller='compare', action='index', | |
259 # repo_name=HG_REPO, | |
260 # org_ref_type="rev", | |
261 # org_ref=rev1, | |
262 # other_ref_type="rev", | |
263 # other_ref=rev2, | |
264 # repo=HG_FORK, | |
265 # bundle=False, | |
266 # )) | |
267 # | |
268 # try: | |
269 # response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_REPO, rev2)) | |
270 # ## outgoing changesets between those revisions | |
271 # | |
272 # response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_REPO)) | |
273 # response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_REPO)) | |
274 # response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_REPO, rev2)) | |
275 # | |
276 # ## files | |
277 # response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2)) | |
278 # response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2)) | |
279 # response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2)) | |
280 # finally: | |
281 # RepoModel().delete(HG_FORK) | |
282 | |
123 def test_compare_extra_commits(self): | 283 def test_compare_extra_commits(self): |
124 self.log_user() | 284 self.log_user() |
125 | 285 |
126 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg', | 286 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg', |
127 description='diff-test', | 287 description='diff-test', |
176 )) | 336 )) |
177 | 337 |
178 try: | 338 try: |
179 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) | 339 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) |
180 | 340 |
181 response.mustcontain("""<div class="message">commit2</div>""") | 341 response.mustcontain("""<div class="message tooltip" title="commit2" style="white-space:normal">commit2</div>""") |
182 response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (r2_name, cs1.raw_id, cs1.short_id)) | 342 response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (r2_name, cs1.raw_id, cs1.short_id)) |
183 ## files | 343 ## files |
184 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s#C--826e8142e6ba">file1</a>""" % (r2_name, rev1, rev2)) | 344 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s#C--826e8142e6ba">file1</a>""" % (r2_name, rev1, rev2)) |
185 | 345 |
186 finally: | 346 finally: |
389 other_ref_type="branch", | 549 other_ref_type="branch", |
390 other_ref=rev2, | 550 other_ref=rev2, |
391 repo=r1_name, | 551 repo=r1_name, |
392 bundle=False | 552 bundle=False |
393 )) | 553 )) |
394 rev2 = cs0.parents[0].raw_id | 554 |
395 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) | 555 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) |
396 response.mustcontain("""file1-line1-from-fork""") | 556 response.mustcontain("""file1-line1-from-fork""") |
397 response.mustcontain("""file2-line1-from-fork""") | 557 response.mustcontain("""file2-line1-from-fork""") |
398 response.mustcontain("""file3-line1-from-fork""") | 558 response.mustcontain("""file3-line1-from-fork""") |
399 self.assertFalse("""<a href="#">file2</a>""" in response.body) # new commit from parent | 559 self.assertFalse("""<a href="#">file2</a>""" in response.body) # new commit from parent |