Show More
@@ -62,14 +62,25 b' def _commit_change(repo, filename, conte' | |||
|
62 | 62 | |
|
63 | 63 | class TestCompareController(TestController): |
|
64 | 64 | |
|
65 | def setUp(self): | |
|
66 | self.r1_id = None | |
|
67 | self.r2_id = None | |
|
68 | ||
|
69 | def tearDown(self): | |
|
70 | if self.r2_id: | |
|
71 | RepoModel().delete(self.r2_id) | |
|
72 | if self.r1_id: | |
|
73 | RepoModel().delete(self.r1_id) | |
|
74 | Session().commit() | |
|
75 | Session.remove() | |
|
76 | ||
|
65 | 77 | def test_compare_forks_on_branch_extra_commits_hg(self): |
|
66 | 78 | self.log_user() |
|
67 | ||
|
68 | 79 | repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg', |
|
69 | 80 | description='diff-test', |
|
70 | 81 | owner=TEST_USER_ADMIN_LOGIN) |
|
71 | r1_id = repo1.repo_id | |
|
72 | 82 | Session().commit() |
|
83 | self.r1_id = repo1.repo_id | |
|
73 | 84 | #commit something ! |
|
74 | 85 | cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n', |
|
75 | 86 | message='commit1', vcs_type='hg', parent=None, newfile=True) |
@@ -77,7 +88,7 b' class TestCompareController(TestControll' | |||
|
77 | 88 | #fork this repo |
|
78 | 89 | repo2 = _fork_repo('one-fork', 'hg', parent='one') |
|
79 | 90 | Session().commit() |
|
80 | r2_id = repo2.repo_id | |
|
91 | self.r2_id = repo2.repo_id | |
|
81 | 92 | |
|
82 | 93 | #add two extra commit into fork |
|
83 | 94 | cs1 = _commit_change(repo2.repo_name, filename='file1', content='line1\nline2\n', |
@@ -89,33 +100,28 b' class TestCompareController(TestControll' | |||
|
89 | 100 | rev1 = 'default' |
|
90 | 101 | rev2 = 'default' |
|
91 | 102 | |
|
92 | ||
|
93 | try: | |
|
94 | response = self.app.get(url(controller='compare', action='index', | |
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 | other_ref=rev1, | |
|
101 | )) | |
|
103 | response = self.app.get(url(controller='compare', action='index', | |
|
104 | repo_name=repo1.repo_name, | |
|
105 | org_ref_type="branch", | |
|
106 | org_ref=rev2, | |
|
107 | other_repo=repo2.repo_name, | |
|
108 | other_ref_type="branch", | |
|
109 | other_ref=rev1, | |
|
110 | )) | |
|
102 | 111 | |
|
103 |
|
|
|
104 |
|
|
|
105 |
|
|
|
112 | response.mustcontain('%s@%s -> %s@%s' % (repo1.repo_name, rev2, repo2.repo_name, rev1)) | |
|
113 | response.mustcontain("""Showing 2 commits""") | |
|
114 | response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") | |
|
106 | 115 | |
|
107 |
|
|
|
108 |
|
|
|
116 | response.mustcontain("""<div class="message tooltip" title="commit2" style="white-space:normal">commit2</div>""") | |
|
117 | response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit3</div>""") | |
|
109 | 118 | |
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 | finally: | |
|
117 | RepoModel().delete(r2_id) | |
|
118 | RepoModel().delete(r1_id) | |
|
119 | response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) | |
|
120 | response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) | |
|
121 | ## files | |
|
122 | response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s#C--826e8142e6ba">file1</a>""" % (repo1.repo_name, rev2, rev1, repo2.repo_name)) | |
|
123 | #swap | |
|
124 | response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?as_form=None&other_repo=%s">[swap]</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) | |
|
119 | 125 | |
|
120 | 126 | def test_compare_forks_on_branch_extra_commits_origin_has_incomming_hg(self): |
|
121 | 127 | self.log_user() |
@@ -123,8 +129,9 b' class TestCompareController(TestControll' | |||
|
123 | 129 | repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg', |
|
124 | 130 | description='diff-test', |
|
125 | 131 | owner=TEST_USER_ADMIN_LOGIN) |
|
126 | r1_id = repo1.repo_id | |
|
127 | 132 | Session().commit() |
|
133 | self.r1_id = repo1.repo_id | |
|
134 | ||
|
128 | 135 | #commit something ! |
|
129 | 136 | cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n', |
|
130 | 137 | message='commit1', vcs_type='hg', parent=None, newfile=True) |
@@ -132,13 +139,12 b' class TestCompareController(TestControll' | |||
|
132 | 139 | #fork this repo |
|
133 | 140 | repo2 = _fork_repo('one-fork', 'hg', parent='one') |
|
134 | 141 | Session().commit() |
|
142 | self.r2_id = repo2.repo_id | |
|
135 | 143 | |
|
136 | 144 | #now commit something to origin repo |
|
137 | 145 | cs1_prim = _commit_change(repo1.repo_name, filename='file2', content='line1file2\n', |
|
138 | 146 | message='commit2', vcs_type='hg', parent=cs0, newfile=True) |
|
139 | 147 | |
|
140 | r2_id = repo2.repo_id | |
|
141 | ||
|
142 | 148 | #add two extra commit into fork |
|
143 | 149 | cs1 = _commit_change(repo2.repo_name, filename='file1', content='line1\nline2\n', |
|
144 | 150 | message='commit2', vcs_type='hg', parent=cs0) |
@@ -149,31 +155,27 b' class TestCompareController(TestControll' | |||
|
149 | 155 | rev1 = 'default' |
|
150 | 156 | rev2 = 'default' |
|
151 | 157 | |
|
152 | try: | |
|
153 | response = self.app.get(url(controller='compare', action='index', | |
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 | )) | |
|
161 | response.mustcontain('%s@%s -> %s@%s' % (repo1.repo_name, rev2, repo2.repo_name, rev1)) | |
|
162 |
|
|
|
163 | response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") | |
|
158 | response = self.app.get(url(controller='compare', action='index', | |
|
159 | repo_name=repo1.repo_name, | |
|
160 | org_ref_type="branch", | |
|
161 | org_ref=rev2, | |
|
162 | other_repo=repo2.repo_name, | |
|
163 | other_ref_type="branch", | |
|
164 | other_ref=rev1, | |
|
165 | )) | |
|
166 | response.mustcontain('%s@%s -> %s@%s' % (repo1.repo_name, rev2, repo2.repo_name, rev1)) | |
|
167 | response.mustcontain("""Showing 2 commits""") | |
|
168 | response.mustcontain("""1 file changed with 2 insertions and 0 deletions""") | |
|
164 | 169 | |
|
165 |
|
|
|
166 |
|
|
|
170 | response.mustcontain("""<div class="message tooltip" title="commit2" style="white-space:normal">commit2</div>""") | |
|
171 | response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit3</div>""") | |
|
167 | 172 | |
|
168 |
|
|
|
169 |
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
|
173 |
|
|
|
174 | finally: | |
|
175 | RepoModel().delete(r2_id) | |
|
176 | RepoModel().delete(r1_id) | |
|
173 | response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (repo2.repo_name, cs1.raw_id, cs1.short_id)) | |
|
174 | response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo2.repo_name, cs2.raw_id, cs2.short_id)) | |
|
175 | ## files | |
|
176 | response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s#C--826e8142e6ba">file1</a>""" % (repo1.repo_name, rev2, rev1, repo2.repo_name)) | |
|
177 | #swap | |
|
178 | response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?as_form=None&other_repo=%s">[swap]</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) | |
|
177 | 179 | |
|
178 | 180 | def test_compare_cherry_pick_changesets_from_bottom(self): |
|
179 | 181 | """ |
@@ -194,8 +196,9 b' class TestCompareController(TestControll' | |||
|
194 | 196 | repo1 = RepoModel().create_repo(repo_name='repo1', repo_type='hg', |
|
195 | 197 | description='diff-test', |
|
196 | 198 | owner=TEST_USER_ADMIN_LOGIN) |
|
197 | r1_id = repo1.repo_id | |
|
198 | 199 | Session().commit() |
|
200 | self.r1_id = repo1.repo_id | |
|
201 | ||
|
199 | 202 | #commit something ! |
|
200 | 203 | cs1 = _commit_change(repo1.repo_name, filename='file1', content='line1\n', |
|
201 | 204 | message='commit1', vcs_type='hg', parent=None, |
@@ -205,7 +208,7 b' class TestCompareController(TestControll' | |||
|
205 | 208 | #fork this repo |
|
206 | 209 | repo2 = _fork_repo('repo1-fork', 'hg', parent='repo1') |
|
207 | 210 | Session().commit() |
|
208 |
r2_id = repo |
|
|
211 | self.r2_id = repo2.repo_id | |
|
209 | 212 | #now make cs3-6 |
|
210 | 213 | cs3 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\n', |
|
211 | 214 | message='commit3', vcs_type='hg', parent=cs2) |
@@ -219,35 +222,31 b' class TestCompareController(TestControll' | |||
|
219 | 222 | rev1 = 'tip' |
|
220 | 223 | rev2 = 'tip' |
|
221 | 224 | |
|
222 | try: | |
|
223 | response = self.app.get(url(controller='compare', action='index', | |
|
224 |
|
|
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
|
232 | )) | |
|
233 | response.mustcontain('%s@%s -> %s@%s' % (repo2.repo_name, rev1, repo1.repo_name, rev2)) | |
|
234 |
|
|
|
235 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") | |
|
225 | response = self.app.get(url(controller='compare', action='index', | |
|
226 | repo_name=repo2.repo_name, | |
|
227 | org_ref_type="tag", | |
|
228 | org_ref=rev1, | |
|
229 | other_repo=repo1.repo_name, | |
|
230 | other_ref_type="tag", | |
|
231 | other_ref=rev2, | |
|
232 | rev_start=cs3.raw_id, | |
|
233 | rev_end=cs5.raw_id, | |
|
234 | )) | |
|
235 | response.mustcontain('%s@%s -> %s@%s' % (repo2.repo_name, rev1, repo1.repo_name, rev2)) | |
|
236 | response.mustcontain("""Showing 3 commits""") | |
|
237 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") | |
|
236 | 238 | |
|
237 |
|
|
|
238 |
|
|
|
239 |
|
|
|
239 | response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit3</div>""") | |
|
240 | response.mustcontain("""<div class="message tooltip" title="commit4" style="white-space:normal">commit4</div>""") | |
|
241 | response.mustcontain("""<div class="message tooltip" title="commit5" style="white-space:normal">commit5</div>""") | |
|
240 | 242 | |
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|
248 | finally: | |
|
249 | RepoModel().delete(r2_id) | |
|
250 | RepoModel().delete(r1_id) | |
|
243 | response.mustcontain("""<a href="/%s/changeset/%s">r3:%s</a>""" % (repo2.repo_name, cs3.raw_id, cs3.short_id)) | |
|
244 | response.mustcontain("""<a href="/%s/changeset/%s">r4:%s</a>""" % (repo2.repo_name, cs4.raw_id, cs4.short_id)) | |
|
245 | response.mustcontain("""<a href="/%s/changeset/%s">r5:%s</a>""" % (repo2.repo_name, cs5.raw_id, cs5.short_id)) | |
|
246 | ## files | |
|
247 | response.mustcontain("""<a href="/%s/compare/tag@%s...tag@%s?other_repo=%s#C--826e8142e6ba">file1</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) | |
|
248 | #swap | |
|
249 | response.mustcontain("""<a href="/%s/compare/tag@%s...tag@%s?as_form=None&other_repo=%s">[swap]</a>""" % (repo1.repo_name, rev1, rev2, repo2.repo_name)) | |
|
251 | 250 | |
|
252 | 251 | def test_compare_cherry_pick_changesets_from_top(self): |
|
253 | 252 | """ |
@@ -264,12 +263,12 b' class TestCompareController(TestControll' | |||
|
264 | 263 | """ |
|
265 | 264 | #make repo1, and cs1+cs2 |
|
266 | 265 | self.log_user() |
|
267 | ||
|
268 | 266 | repo1 = RepoModel().create_repo(repo_name='repo1', repo_type='hg', |
|
269 | 267 | description='diff-test', |
|
270 | 268 | owner=TEST_USER_ADMIN_LOGIN) |
|
271 | r1_id = repo1.repo_id | |
|
272 | 269 | Session().commit() |
|
270 | self.r1_id = repo1.repo_id | |
|
271 | ||
|
273 | 272 | #commit something ! |
|
274 | 273 | cs1 = _commit_change(repo1.repo_name, filename='file1', content='line1\n', |
|
275 | 274 | message='commit1', vcs_type='hg', parent=None, |
@@ -279,7 +278,7 b' class TestCompareController(TestControll' | |||
|
279 | 278 | #fork this repo |
|
280 | 279 | repo2 = _fork_repo('repo1-fork', 'hg', parent='repo1') |
|
281 | 280 | Session().commit() |
|
282 | r2_id = repo1.repo_id | |
|
281 | self.r2_id = repo1.repo_id | |
|
283 | 282 | #now make cs3-6 |
|
284 | 283 | cs3 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\n', |
|
285 | 284 | message='commit3', vcs_type='hg', parent=cs2) |
@@ -289,40 +288,35 b' class TestCompareController(TestControll' | |||
|
289 | 288 | message='commit5', vcs_type='hg', parent=cs4) |
|
290 | 289 | cs6 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n', |
|
291 | 290 | message='commit6', vcs_type='hg', parent=cs5) |
|
292 | ||
|
293 | 291 | rev1 = 'tip' |
|
294 | 292 | rev2 = 'tip' |
|
295 | 293 | |
|
296 | try: | |
|
297 | response = self.app.get(url(controller='compare', action='index', | |
|
298 |
|
|
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
|
304 |
|
|
|
305 |
|
|
|
306 | )) | |
|
294 | response = self.app.get(url(controller='compare', action='index', | |
|
295 | repo_name=repo2.repo_name, | |
|
296 | org_ref_type="tag", | |
|
297 | org_ref=rev1, | |
|
298 | other_repo=repo1.repo_name, | |
|
299 | other_ref_type="tag", | |
|
300 | other_ref=rev2, | |
|
301 | rev_start=cs4.raw_id, | |
|
302 | rev_end=cs6.raw_id, | |
|
303 | )) | |
|
307 | 304 | |
|
308 |
|
|
|
309 |
|
|
|
310 |
|
|
|
305 | response.mustcontain('%s@%s -> %s@%s' % (repo2.repo_name, rev1, repo1.repo_name, rev2)) | |
|
306 | response.mustcontain("""Showing 3 commits""") | |
|
307 | response.mustcontain("""1 file changed with 3 insertions and 0 deletions""") | |
|
311 | 308 | |
|
312 |
|
|
|
313 |
|
|
|
314 |
|
|
|
309 | response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit4</div>""") | |
|
310 | response.mustcontain("""<div class="message tooltip" title="commit4" style="white-space:normal">commit5</div>""") | |
|
311 | response.mustcontain("""<div class="message tooltip" title="commit5" style="white-space:normal">commit6</div>""") | |
|
315 | 312 | |
|
316 |
|
|
|
317 |
|
|
|
318 |
|
|
|
319 |
|
|
|
320 |
|
|
|
321 |
|
|
|
322 |
|
|
|
323 | finally: | |
|
324 | RepoModel().delete(r2_id) | |
|
325 | RepoModel().delete(r1_id) | |
|
313 | response.mustcontain("""<a href="/%s/changeset/%s">r4:%s</a>""" % (repo2.repo_name, cs4.raw_id, cs4.short_id)) | |
|
314 | response.mustcontain("""<a href="/%s/changeset/%s">r5:%s</a>""" % (repo2.repo_name, cs5.raw_id, cs5.short_id)) | |
|
315 | response.mustcontain("""<a href="/%s/changeset/%s">r6:%s</a>""" % (repo2.repo_name, cs6.raw_id, cs6.short_id)) | |
|
316 | ## files | |
|
317 | response.mustcontain("""<a href="/%s/compare/tag@%s...tag@%s?other_repo=%s#C--826e8142e6ba">file1</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name)) | |
|
318 | #swap | |
|
319 | response.mustcontain("""<a href="/%s/compare/tag@%s...tag@%s?as_form=None&other_repo=%s">[swap]</a>""" % (repo1.repo_name, rev1, rev2, repo2.repo_name)) | |
|
326 | 320 | |
|
327 | 321 | def test_compare_cherry_pick_changeset_mixed_branches(self): |
|
328 | 322 | """ |
@@ -339,28 +333,25 b' class TestCompareController(TestControll' | |||
|
339 | 333 | rev1 = '56349e29c2af' |
|
340 | 334 | rev2 = '7d4bc8ec6be5' |
|
341 | 335 | |
|
342 | try: | |
|
343 | response = self.app.get(url(controller='compare', action='index', | |
|
344 |
|
|
|
345 |
|
|
|
346 |
|
|
|
347 |
|
|
|
348 |
|
|
|
349 |
|
|
|
350 | )) | |
|
351 | response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_FORK, rev2)) | |
|
352 | ## outgoing changesets between those revisions | |
|
336 | response = self.app.get(url(controller='compare', action='index', | |
|
337 | repo_name=HG_REPO, | |
|
338 | org_ref_type="rev", | |
|
339 | org_ref=rev1, | |
|
340 | other_ref_type="rev", | |
|
341 | other_ref=rev2, | |
|
342 | other_repo=HG_FORK, | |
|
343 | )) | |
|
344 | response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_FORK, rev2)) | |
|
345 | ## outgoing changesets between those revisions | |
|
353 | 346 | |
|
354 |
|
|
|
355 |
|
|
|
356 |
|
|
|
347 | response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_FORK)) | |
|
348 | response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_FORK)) | |
|
349 | response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_FORK, rev2)) | |
|
357 | 350 | |
|
358 |
|
|
|
359 |
|
|
|
360 |
|
|
|
361 |
|
|
|
362 | finally: | |
|
363 | RepoModel().delete(HG_FORK) | |
|
351 | ## files | |
|
352 | response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s?other_repo=%s#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2, HG_FORK)) | |
|
353 | response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s?other_repo=%s#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2, HG_FORK)) | |
|
354 | response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s?other_repo=%s#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2, HG_FORK)) | |
|
364 | 355 | |
|
365 | 356 | def test_org_repo_new_commits_after_forking_simple_diff(self): |
|
366 | 357 | self.log_user() |
@@ -370,7 +361,7 b' class TestCompareController(TestControll' | |||
|
370 | 361 | owner=TEST_USER_ADMIN_LOGIN) |
|
371 | 362 | |
|
372 | 363 | Session().commit() |
|
373 | r1_id = repo1.repo_id | |
|
364 | self.r1_id = repo1.repo_id | |
|
374 | 365 | r1_name = repo1.repo_name |
|
375 | 366 | |
|
376 | 367 | #commit something initially ! |
@@ -391,7 +382,7 b' class TestCompareController(TestControll' | |||
|
391 | 382 | owner=TEST_USER_ADMIN_LOGIN, fork_of='one') |
|
392 | 383 | Session().commit() |
|
393 | 384 | self.assertEqual(repo2.scm_instance.revisions, [cs0.raw_id]) |
|
394 | r2_id = repo2.repo_id | |
|
385 | self.r2_id = repo2.repo_id | |
|
395 | 386 | r2_name = repo2.repo_name |
|
396 | 387 | |
|
397 | 388 | #make 3 new commits in fork |
@@ -424,46 +415,41 b' class TestCompareController(TestControll' | |||
|
424 | 415 | rev1 = 'default' |
|
425 | 416 | rev2 = 'default' |
|
426 | 417 | |
|
427 | try: | |
|
428 | response = self.app.get(url(controller='compare', action='index', | |
|
429 |
|
|
|
430 |
|
|
|
431 |
|
|
|
432 |
|
|
|
433 |
|
|
|
434 |
|
|
|
435 | )) | |
|
436 | #response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) | |
|
418 | response = self.app.get(url(controller='compare', action='index', | |
|
419 | repo_name=r2_name, | |
|
420 | org_ref_type="branch", | |
|
421 | org_ref=rev1, | |
|
422 | other_ref_type="branch", | |
|
423 | other_ref=rev2, | |
|
424 | other_repo=r1_name, | |
|
425 | )) | |
|
426 | response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) | |
|
427 | response.mustcontain('No files') | |
|
428 | response.mustcontain('No changesets') | |
|
437 | 429 | |
|
438 |
|
|
|
439 |
|
|
|
440 |
|
|
|
441 |
|
|
|
442 |
|
|
|
443 |
|
|
|
444 |
|
|
|
445 |
|
|
|
446 |
|
|
|
447 |
|
|
|
448 |
|
|
|
449 |
|
|
|
450 |
|
|
|
451 |
|
|
|
452 |
|
|
|
453 |
|
|
|
454 |
|
|
|
455 |
|
|
|
456 |
|
|
|
457 |
|
|
|
458 | )) | |
|
430 | #add new commit into parent ! | |
|
431 | cs0 = ScmModel().create_node( | |
|
432 | repo=repo1.scm_instance, repo_name=r1_name, | |
|
433 | cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN, | |
|
434 | author=TEST_USER_ADMIN_LOGIN, | |
|
435 | message='commit2-parent', | |
|
436 | content='line1-added-after-fork', | |
|
437 | f_path='file2' | |
|
438 | ) | |
|
439 | #compare ! | |
|
440 | rev1 = 'default' | |
|
441 | rev2 = 'default' | |
|
442 | response = self.app.get(url(controller='compare', action='index', | |
|
443 | repo_name=r2_name, | |
|
444 | org_ref_type="branch", | |
|
445 | org_ref=rev1, | |
|
446 | other_ref_type="branch", | |
|
447 | other_ref=rev2, | |
|
448 | other_repo=r1_name, | |
|
449 | )) | |
|
459 | 450 | |
|
460 |
|
|
|
461 | response.mustcontain("""file1-line1-from-fork""") | |
|
462 |
|
|
|
463 |
|
|
|
464 | self.assertFalse("""<a href="#">file2</a>""" in response.body) # new commit from parent | |
|
465 | self.assertFalse("""line1-from-new-parent""" in response.body) | |
|
466 | finally: | |
|
467 | RepoModel().delete(r2_id) | |
|
468 | RepoModel().delete(r1_id) | |
|
469 | Session() | |
|
451 | response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2)) | |
|
452 | ||
|
453 | response.mustcontain("""commit2-parent""") | |
|
454 | response.mustcontain("""1 file changed with 1 insertions and 0 deletions""") | |
|
455 | response.mustcontain("""line1-added-after-fork""") |
General Comments 0
You need to be logged in to leave comments.
Login now