annotate rhodecode/tests/functional/test_compare.py @ 2963:742d1b8ca263 beta

use str() on os.walk passing unicode can lead to UnicodeDecode errors when iterating
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 26 Oct 2012 00:26:20 +0200
parents 0b86972de820
children 16af24982e30
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2241
b2a2868d7bec Basic compare-view controller with ref parsing
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 from rhodecode.tests import *
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
2 from rhodecode.model.repo import RepoModel
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
3 from rhodecode.model.meta import Session
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
4 from rhodecode.model.db import Repository
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
5 from rhodecode.model.scm import ScmModel
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
6 from rhodecode.lib.vcs.backends.base import EmptyChangeset
2241
b2a2868d7bec Basic compare-view controller with ref parsing
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
8
2241
b2a2868d7bec Basic compare-view controller with ref parsing
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 class TestCompareController(TestController):
b2a2868d7bec Basic compare-view controller with ref parsing
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
11 def test_index_tag(self):
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
12 self.log_user()
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
13 tag1 = '0.1.3'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
14 tag2 = '0.1.2'
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
15 response = self.app.get(url(controller='compare', action='index',
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
16 repo_name=HG_REPO,
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
17 org_ref_type="tag",
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
18 org_ref=tag1,
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
19 other_ref_type="tag",
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
20 other_ref=tag2,
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
21 ))
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
22 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, tag1, HG_REPO, tag2))
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
23 ## outgoing changesets between tags
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
24 response.mustcontain('''<a href="/%s/changeset/17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">r120:17544fbfcd33</a>''' % HG_REPO)
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
25 response.mustcontain('''<a href="/%s/changeset/36e0fc9d2808c5022a24f49d6658330383ed8666">r119:36e0fc9d2808</a>''' % HG_REPO)
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
26 response.mustcontain('''<a href="/%s/changeset/bb1a3ab98cc45cb934a77dcabf87a5a598b59e97">r118:bb1a3ab98cc4</a>''' % HG_REPO)
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
27 response.mustcontain('''<a href="/%s/changeset/41fda979f02fda216374bf8edac4e83f69e7581c">r117:41fda979f02f</a>''' % HG_REPO)
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
28 response.mustcontain('''<a href="/%s/changeset/9749bfbfc0d2eba208d7947de266303b67c87cda">r116:9749bfbfc0d2</a>''' % HG_REPO)
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
29 response.mustcontain('''<a href="/%s/changeset/70d4cef8a37657ee4cf5aabb3bd9f68879769816">r115:70d4cef8a376</a>''' % HG_REPO)
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
30 response.mustcontain('''<a href="/%s/changeset/c5ddebc06eaaba3010c2d66ea6ec9d074eb0f678">r112:c5ddebc06eaa</a>''' % HG_REPO)
2478
8eab81115660 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2434
diff changeset
31
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
32 ## files diff
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
35 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--c8e92ef85cd1">.hgignore</a></div>''' % (HG_REPO, tag1, tag2))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
36 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--6e08b694d687">.hgtags</a></div>''' % (HG_REPO, tag1, tag2))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
37 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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
38 response.mustcontain('''<div class="node"><a href="/%s/compare/tag@%s...tag@%s#C--430ccbc82bdf">vcs/__init__.py</a></div>''' % (HG_REPO, tag1, tag2))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
39 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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
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))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
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))
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
44
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
45 def test_index_branch(self):
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
46 self.log_user()
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
47 response = self.app.get(url(controller='compare', action='index',
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
48 repo_name=HG_REPO,
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
49 org_ref_type="branch",
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
50 org_ref='default',
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
51 other_ref_type="branch",
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
52 other_ref='default',
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
53 ))
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
54
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
55 response.mustcontain('%s@default -> %s@default' % (HG_REPO, HG_REPO))
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
56 # branch are equal
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2241
diff changeset
57 response.mustcontain('<tr><td>No changesets</td></tr>')
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
58
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
59 def test_compare_revisions(self):
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
60 self.log_user()
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
61 rev1 = '3d8f361e72ab'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
62 rev2 = 'b986218ba1c9'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
63 response = self.app.get(url(controller='compare', action='index',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
64 repo_name=HG_REPO,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
65 org_ref_type="rev",
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
66 org_ref=rev1,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
67 other_ref_type="rev",
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
68 other_ref=rev2,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
69 ))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
70 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_REPO, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
71 ## outgoing changesets between those revisions
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
72 response.mustcontain("""<a href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (HG_REPO, rev1))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
73
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
74 ## files
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
75 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--c8e92ef85cd1">.hgignore</a>""" % (HG_REPO, rev1, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
76
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
77 def test_compare_remote_repos(self):
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
78 self.log_user()
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
79
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
80 form_data = dict(
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
81 repo_name=HG_FORK,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
82 repo_name_full=HG_FORK,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
83 repo_group=None,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
84 repo_type='hg',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
85 description='',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
86 private=False,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
87 copy_permissions=False,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
88 landing_rev='tip',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
89 update_after_clone=False,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
90 fork_parent_id=Repository.get_by_repo_name(HG_REPO),
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
91 )
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
92 RepoModel().create_fork(form_data, cur_user=TEST_USER_ADMIN_LOGIN)
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
93
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
94 Session().commit()
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
95
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
96 rev1 = '7d4bc8ec6be5'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
97 rev2 = '56349e29c2af'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
98
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
99 response = self.app.get(url(controller='compare', action='index',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
100 repo_name=HG_REPO,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
101 org_ref_type="rev",
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
102 org_ref=rev1,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
103 other_ref_type="rev",
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
104 other_ref=rev2,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
105 repo=HG_FORK
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
106 ))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
107
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
108 try:
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
109 response.mustcontain('%s@%s -> %s@%s' % (HG_REPO, rev1, HG_FORK, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
110 ## outgoing changesets between those revisions
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
111
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
112 response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_REPO, rev1))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
113 response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_REPO))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
114 response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_REPO))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
115
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
116 ## files
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
117 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
118 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
119 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
120 finally:
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
121 RepoModel().delete(HG_FORK)
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
122
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
123 def test_compare_extra_commits(self):
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
124 self.log_user()
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
125
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
126 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
127 description='diff-test',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
128 owner=TEST_USER_ADMIN_LOGIN)
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
129
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
130 repo2 = RepoModel().create_repo(repo_name='one-fork', repo_type='hg',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
131 description='diff-test',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
132 owner=TEST_USER_ADMIN_LOGIN)
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
133
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
134 Session().commit()
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
135 r1_id = repo1.repo_id
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
136 r1_name = repo1.repo_name
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
137 r2_id = repo2.repo_id
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
138 r2_name = repo2.repo_name
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
139
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
140 #commit something !
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
141 cs0 = ScmModel().create_node(
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
142 repo=repo1.scm_instance, repo_name=r1_name,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
143 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
144 author=TEST_USER_ADMIN_LOGIN,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
145 message='commit1',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
146 content='line1',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
147 f_path='file1'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
148 )
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
149
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
150 cs0_prim = ScmModel().create_node(
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
151 repo=repo2.scm_instance, repo_name=r2_name,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
152 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
153 author=TEST_USER_ADMIN_LOGIN,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
154 message='commit1',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
155 content='line1',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
156 f_path='file1'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
157 )
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
158
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
159 cs1 = ScmModel().commit_change(
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
160 repo=repo2.scm_instance, repo_name=r2_name,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
161 cs=cs0_prim, user=TEST_USER_ADMIN_LOGIN, author=TEST_USER_ADMIN_LOGIN,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
162 message='commit2',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
163 content='line1\nline2',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
164 f_path='file1'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
165 )
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
166
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
167 rev1 = 'default'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
168 rev2 = 'default'
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
169 response = self.app.get(url(controller='compare', action='index',
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
170 repo_name=r2_name,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
171 org_ref_type="branch",
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
172 org_ref=rev1,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
173 other_ref_type="branch",
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
174 other_ref=rev2,
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
175 repo=r1_name
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
176 ))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
177
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
178 try:
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
179 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
180
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
181 response.mustcontain("""<div class="message">commit2</div>""")
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
182 response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (r2_name, cs1.raw_id, cs1.short_id))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
183 ## files
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
184 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s#C--826e8142e6ba">file1</a>""" % (r2_name, rev1, rev2))
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
185
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
186 finally:
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
187 RepoModel().delete(r1_id)
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
188 RepoModel().delete(r2_id)
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
189
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
190 def test_org_repo_new_commits_after_forking(self):
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
191 self.log_user()
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
192
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
193 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
194 description='diff-test',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
195 owner=TEST_USER_ADMIN_LOGIN)
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
196
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
197 Session().commit()
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
198 r1_id = repo1.repo_id
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
199 r1_name = repo1.repo_name
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
200
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
201 #commit something initially !
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
202 cs0 = ScmModel().create_node(
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
203 repo=repo1.scm_instance, repo_name=r1_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
204 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
205 author=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
206 message='commit1',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
207 content='line1',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
208 f_path='file1'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
209 )
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
210 Session().commit()
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
211 self.assertEqual(repo1.scm_instance.revisions, [cs0.raw_id])
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
212 #fork the repo1
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
213 repo2 = RepoModel().create_repo(repo_name='one-fork', repo_type='hg',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
214 description='compare-test',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
215 clone_uri=repo1.repo_full_path,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
216 owner=TEST_USER_ADMIN_LOGIN, fork_of='one')
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
217 Session().commit()
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
218 self.assertEqual(repo2.scm_instance.revisions, [cs0.raw_id])
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
219 r2_id = repo2.repo_id
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
220 r2_name = repo2.repo_name
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
221
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
222 #make 3 new commits in fork
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
223 cs1 = ScmModel().create_node(
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
224 repo=repo2.scm_instance, repo_name=r2_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
225 cs=repo2.scm_instance[-1], user=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
226 author=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
227 message='commit1-fork',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
228 content='file1-line1-from-fork',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
229 f_path='file1-fork'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
230 )
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
231 cs2 = ScmModel().create_node(
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
232 repo=repo2.scm_instance, repo_name=r2_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
233 cs=cs1, user=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
234 author=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
235 message='commit2-fork',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
236 content='file2-line1-from-fork',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
237 f_path='file2-fork'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
238 )
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
239 cs3 = ScmModel().create_node(
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
240 repo=repo2.scm_instance, repo_name=r2_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
241 cs=cs2, user=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
242 author=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
243 message='commit3-fork',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
244 content='file3-line1-from-fork',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
245 f_path='file3-fork'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
246 )
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
247
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
248 #compare !
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
249 rev1 = 'default'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
250 rev2 = 'default'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
251 response = self.app.get(url(controller='compare', action='index',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
252 repo_name=r2_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
253 org_ref_type="branch",
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
254 org_ref=rev1,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
255 other_ref_type="branch",
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
256 other_ref=rev2,
2892
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
257 repo=r1_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
258 bundle=True,
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
259 ))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
260
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
261 try:
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
262 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
263 response.mustcontain("""file1-line1-from-fork""")
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
264 response.mustcontain("""file2-line1-from-fork""")
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
265 response.mustcontain("""file3-line1-from-fork""")
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
266
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
267 #add new commit into parent !
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
268 cs0 = ScmModel().create_node(
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
269 repo=repo1.scm_instance, repo_name=r1_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
270 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
271 author=TEST_USER_ADMIN_LOGIN,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
272 message='commit2',
2892
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
273 content='line1-from-new-parent',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
274 f_path='file2'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
275 )
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
276 #compare !
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
277 rev1 = 'default'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
278 rev2 = 'default'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
279 response = self.app.get(url(controller='compare', action='index',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
280 repo_name=r2_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
281 org_ref_type="branch",
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
282 org_ref=rev1,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
283 other_ref_type="branch",
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
284 other_ref=rev2,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
285 repo=r1_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
286 bundle=True,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
287 ))
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
288
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
289 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2))
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
290 response.mustcontain("""<a href="#">file2</a>""") # new commit from parent
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
291 response.mustcontain("""line1-from-new-parent""")
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
292 response.mustcontain("""file1-line1-from-fork""")
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
293 response.mustcontain("""file2-line1-from-fork""")
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
294 response.mustcontain("""file3-line1-from-fork""")
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
295 finally:
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
296 RepoModel().delete(r2_id)
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
297 RepoModel().delete(r1_id)
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
298
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
299 def test_org_repo_new_commits_after_forking_simple_diff(self):
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
300 self.log_user()
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
301
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
302 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
303 description='diff-test',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
304 owner=TEST_USER_ADMIN_LOGIN)
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
305
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
306 Session().commit()
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
307 r1_id = repo1.repo_id
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
308 r1_name = repo1.repo_name
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
309
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
310 #commit something initially !
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
311 cs0 = ScmModel().create_node(
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
312 repo=repo1.scm_instance, repo_name=r1_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
313 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
314 author=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
315 message='commit1',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
316 content='line1',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
317 f_path='file1'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
318 )
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
319 Session().commit()
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
320 self.assertEqual(repo1.scm_instance.revisions, [cs0.raw_id])
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
321 #fork the repo1
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
322 repo2 = RepoModel().create_repo(repo_name='one-fork', repo_type='hg',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
323 description='compare-test',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
324 clone_uri=repo1.repo_full_path,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
325 owner=TEST_USER_ADMIN_LOGIN, fork_of='one')
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
326 Session().commit()
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
327 self.assertEqual(repo2.scm_instance.revisions, [cs0.raw_id])
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
328 r2_id = repo2.repo_id
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
329 r2_name = repo2.repo_name
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
330
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
331 #make 3 new commits in fork
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
332 cs1 = ScmModel().create_node(
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
333 repo=repo2.scm_instance, repo_name=r2_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
334 cs=repo2.scm_instance[-1], user=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
335 author=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
336 message='commit1-fork',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
337 content='file1-line1-from-fork',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
338 f_path='file1-fork'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
339 )
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
340 cs2 = ScmModel().create_node(
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
341 repo=repo2.scm_instance, repo_name=r2_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
342 cs=cs1, user=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
343 author=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
344 message='commit2-fork',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
345 content='file2-line1-from-fork',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
346 f_path='file2-fork'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
347 )
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
348 cs3 = ScmModel().create_node(
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
349 repo=repo2.scm_instance, repo_name=r2_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
350 cs=cs2, user=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
351 author=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
352 message='commit3-fork',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
353 content='file3-line1-from-fork',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
354 f_path='file3-fork'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
355 )
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
356
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
357 #compare !
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
358 rev1 = 'default'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
359 rev2 = 'default'
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
360 response = self.app.get(url(controller='compare', action='index',
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
361 repo_name=r2_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
362 org_ref_type="branch",
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
363 org_ref=rev1,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
364 other_ref_type="branch",
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
365 other_ref=rev2,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
366 repo=r1_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
367 bundle=False,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
368 ))
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
369
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
370 try:
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
371 #response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2))
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
372
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
373 #add new commit into parent !
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
374 cs0 = ScmModel().create_node(
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
375 repo=repo1.scm_instance, repo_name=r1_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
376 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
377 author=TEST_USER_ADMIN_LOGIN,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
378 message='commit2',
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
379 content='line1',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
380 f_path='file2'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
381 )
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
382 #compare !
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
383 rev1 = 'default'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
384 rev2 = 'default'
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
385 response = self.app.get(url(controller='compare', action='index',
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
386 repo_name=r2_name,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
387 org_ref_type="branch",
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
388 org_ref=rev1,
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
389 other_ref_type="branch",
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
390 other_ref=rev2,
2892
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
391 repo=r1_name,
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
392 bundle=False
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
393 ))
2892
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
394 rev2 = cs0.parents[0].raw_id
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
395 response.mustcontain('%s@%s -> %s@%s' % (r2_name, rev1, r1_name, rev2))
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
396 response.mustcontain("""file1-line1-from-fork""")
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
397 response.mustcontain("""file2-line1-from-fork""")
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
398 response.mustcontain("""file3-line1-from-fork""")
2892
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
399 self.assertFalse("""<a href="#">file2</a>""" in response.body) # new commit from parent
5fba3778431c #590 Add GET flag that controls the way the diff are generated, for pull requests we want to use non-bundle based diffs,
Marcin Kuzminski <marcin@python-works.com>
parents: 2820
diff changeset
400 self.assertFalse("""line1-from-new-parent""" in response.body)
2801
69420c48a0e6 fixes #550 mercurial repositories comparision failed when origin repo had
Marcin Kuzminski <marcin@python-works.com>
parents: 2684
diff changeset
401 finally:
2816
b80375835974 fixed tests for mysql and postgres
Marcin Kuzminski <marcin@python-works.com>
parents: 2801
diff changeset
402 RepoModel().delete(r2_id)
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2892
diff changeset
403 RepoModel().delete(r1_id)