annotate rhodecode/tests/functional/test_compare.py @ 3486:2053053e0882 beta

compare/pullrequest: introduce merge parameter This is more correct and flexible than the old way of looking on same/different repo.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 05 Mar 2013 11:55:01 +0100
parents 75e563531350
children aef5f5ce5ead
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
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
9 def _fork_repo(fork_name, vcs_type, parent=None):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
10 if vcs_type =='hg':
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
11 _REPO = HG_REPO
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
12 elif vcs_type == 'git':
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
13 _REPO = GIT_REPO
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
14
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
15 if parent:
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
16 _REPO = parent
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
17
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
18 form_data = dict(
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
19 repo_name=fork_name,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
20 repo_name_full=fork_name,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
21 repo_group=None,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
22 repo_type=vcs_type,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
23 description='',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
24 private=False,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
25 copy_permissions=False,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
26 landing_rev='tip',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
27 update_after_clone=False,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
28 fork_parent_id=Repository.get_by_repo_name(_REPO),
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
29 )
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
30 RepoModel().create_fork(form_data, cur_user=TEST_USER_ADMIN_LOGIN)
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
31
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
32 Session().commit()
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
33 return Repository.get_by_repo_name(fork_name)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
34
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
35
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
36 def _commit_change(repo, filename, content, message, vcs_type, parent=None, newfile=False):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
37 repo = Repository.get_by_repo_name(repo)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
38 _cs = parent
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
39 if not parent:
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
40 _cs = EmptyChangeset(alias=vcs_type)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
41
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
42 if newfile:
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
43 cs = ScmModel().create_node(
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
44 repo=repo.scm_instance, repo_name=repo.repo_name,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
45 cs=_cs, user=TEST_USER_ADMIN_LOGIN,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
46 author=TEST_USER_ADMIN_LOGIN,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
47 message=message,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
48 content=content,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
49 f_path=filename
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
50 )
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
51 else:
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
52 cs = ScmModel().commit_change(
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
53 repo=repo.scm_instance, repo_name=repo.repo_name,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
54 cs=parent, user=TEST_USER_ADMIN_LOGIN,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
55 author=TEST_USER_ADMIN_LOGIN,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
56 message=message,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
57 content=content,
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
58 f_path=filename
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
59 )
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
60 return cs
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
61
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
62
2241
b2a2868d7bec Basic compare-view controller with ref parsing
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
63 class TestCompareController(TestController):
b2a2868d7bec Basic compare-view controller with ref parsing
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
64
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
65 def setUp(self):
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
66 self.r1_id = None
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
67 self.r2_id = None
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
68
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
69 def tearDown(self):
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
70 if self.r2_id:
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
71 RepoModel().delete(self.r2_id)
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
72 if self.r1_id:
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
73 RepoModel().delete(self.r1_id)
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
74 Session().commit()
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
75 Session.remove()
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
76
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
77 def test_compare_forks_on_branch_extra_commits_hg(self):
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
78 self.log_user()
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
79 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
80 description='diff-test',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
81 owner=TEST_USER_ADMIN_LOGIN)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
82 Session().commit()
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
83 self.r1_id = repo1.repo_id
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
84 #commit something !
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
85 cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
86 message='commit1', vcs_type='hg', parent=None, newfile=True)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
87
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
88 #fork this repo
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
89 repo2 = _fork_repo('one-fork', 'hg', parent='one')
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
90 self.r2_id = repo2.repo_id
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
91
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
92 #add two extra commit into fork
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
93 cs1 = _commit_change(repo2.repo_name, filename='file1', content='line1\nline2\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
94 message='commit2', vcs_type='hg', parent=cs0)
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
95
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
96 cs2 = _commit_change(repo2.repo_name, filename='file1', content='line1\nline2\nline3\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
97 message='commit3', vcs_type='hg', parent=cs1)
3015
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
98
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
99 rev1 = 'default'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
100 rev2 = 'default'
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
101
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
102 response = self.app.get(url(controller='compare', action='index',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
103 repo_name=repo1.repo_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
104 org_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
105 org_ref=rev2,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
106 other_repo=repo2.repo_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
107 other_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
108 other_ref=rev1,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
109 merge='1',
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
110 ))
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
111
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
112 response.mustcontain('%s@%s -&gt; %s@%s' % (repo1.repo_name, rev2, repo2.repo_name, rev1))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
113 response.mustcontain("""Showing 2 commits""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
114 response.mustcontain("""1 file changed with 2 insertions and 0 deletions""")
3015
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
115
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
116 response.mustcontain("""<div class="message tooltip" title="commit2" style="white-space:normal">commit2</div>""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
117 response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit3</div>""")
3015
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
118
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
119 response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (repo2.repo_name, cs1.raw_id, cs1.short_id))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
120 response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
121 ## files
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
122 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s&amp;merge=1#C--826e8142e6ba">file1</a>""" % (repo1.repo_name, rev2, rev1, repo2.repo_name))
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
123 #swap
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
124 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s&amp;merge=True">[swap]</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name))
3029
685ebc84c2e9 White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3026
diff changeset
125
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
126 def test_compare_forks_on_branch_extra_commits_origin_has_incomming_hg(self):
3015
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
127 self.log_user()
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
128
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
129 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
130 description='diff-test',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
131 owner=TEST_USER_ADMIN_LOGIN)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
132 Session().commit()
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
133 self.r1_id = repo1.repo_id
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
134
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
135 #commit something !
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
136 cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
137 message='commit1', vcs_type='hg', parent=None, newfile=True)
3015
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
138
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
139 #fork this repo
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
140 repo2 = _fork_repo('one-fork', 'hg', parent='one')
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
141 self.r2_id = repo2.repo_id
3015
16af24982e30 Multiple changes for compare system
Marcin Kuzminski <marcin@python-works.com>
parents: 2907
diff changeset
142
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
143 #now commit something to origin repo
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
144 cs1_prim = _commit_change(repo1.repo_name, filename='file2', content='line1file2\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
145 message='commit2', vcs_type='hg', parent=cs0, newfile=True)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
146
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
147 #add two extra commit into fork
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
148 cs1 = _commit_change(repo2.repo_name, filename='file1', content='line1\nline2\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
149 message='commit2', vcs_type='hg', parent=cs0)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
150
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
151 cs2 = _commit_change(repo2.repo_name, filename='file1', content='line1\nline2\nline3\n',
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
152 message='commit3', vcs_type='hg', parent=cs1)
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
153
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
154 rev1 = 'default'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
155 rev2 = 'default'
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
156
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
157 response = self.app.get(url(controller='compare', action='index',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
158 repo_name=repo1.repo_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
159 org_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
160 org_ref=rev2,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
161 other_repo=repo2.repo_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
162 other_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
163 other_ref=rev1,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
164 merge='x',
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
165 ))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
166 response.mustcontain('%s@%s -&gt; %s@%s' % (repo1.repo_name, rev2, repo2.repo_name, rev1))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
167 response.mustcontain("""Showing 2 commits""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
168 response.mustcontain("""1 file changed with 2 insertions and 0 deletions""")
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
169
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
170 response.mustcontain("""<div class="message tooltip" title="commit2" style="white-space:normal">commit2</div>""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
171 response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit3</div>""")
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
172
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
173 response.mustcontain("""<a href="/%s/changeset/%s">r1:%s</a>""" % (repo2.repo_name, cs1.raw_id, cs1.short_id))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
174 response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
175 ## files
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
176 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s&amp;merge=x#C--826e8142e6ba">file1</a>""" % (repo1.repo_name, rev2, rev1, repo2.repo_name))
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
177 #swap
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
178 response.mustcontain("""<a href="/%s/compare/branch@%s...branch@%s?other_repo=%s&amp;merge=True">[swap]</a>""" % (repo2.repo_name, rev1, rev2, repo1.repo_name))
2684
2b6939a77052 Bumped mercurial version to 2.3
Marcin Kuzminski <marcin@python-works.com>
parents: 2478
diff changeset
179
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
180 def test_compare_cherry_pick_changesets_from_bottom(self):
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
181
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
182 # repo1:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
183 # cs0:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
184 # cs1:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
185 # repo1-fork- in which we will cherry pick bottom changesets
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
186 # cs0:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
187 # cs1:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
188 # cs2: x
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
189 # cs3: x
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
190 # cs4: x
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
191 # cs5:
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
192 #make repo1, and cs1+cs2
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
193 self.log_user()
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3015
diff changeset
194
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
195 repo1 = RepoModel().create_repo(repo_name='repo1', repo_type='hg',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
196 description='diff-test',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
197 owner=TEST_USER_ADMIN_LOGIN)
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
198 Session().commit()
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
199 self.r1_id = repo1.repo_id
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
200
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
201 #commit something !
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
202 cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n',
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
203 message='commit1', vcs_type='hg', parent=None,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
204 newfile=True)
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
205 cs1 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
206 message='commit2', vcs_type='hg', parent=cs0)
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
207 #fork this repo
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
208 repo2 = _fork_repo('repo1-fork', 'hg', parent='repo1')
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
209 self.r2_id = repo2.repo_id
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
210 #now make cs3-6
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
211 cs2 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
212 message='commit3', vcs_type='hg', parent=cs1)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
213 cs3 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
214 message='commit4', vcs_type='hg', parent=cs2)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
215 cs4 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
216 message='commit5', vcs_type='hg', parent=cs3)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
217 cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
218 message='commit6', vcs_type='hg', parent=cs4)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
219
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
220 response = self.app.get(url(controller='compare', action='index',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
221 repo_name=repo2.repo_name,
3484
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
222 org_ref_type="rev",
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
223 org_ref=cs1.short_id, # parent of cs2, in repo2
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
224 other_repo=repo1.repo_name,
3484
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
225 other_ref_type="rev",
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
226 other_ref=cs4.short_id,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
227 merge='True',
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
228 ))
3484
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
229 response.mustcontain('%s@%s -&gt; %s@%s' % (repo2.repo_name, cs1.short_id, repo1.repo_name, cs4.short_id))
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
230 response.mustcontain("""Showing 3 commits""")
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
231 response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
232
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
233 response.mustcontain("""<div class="message tooltip" title="commit3" style="white-space:normal">commit3</div>""")
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
234 response.mustcontain("""<div class="message tooltip" title="commit4" style="white-space:normal">commit4</div>""")
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
235 response.mustcontain("""<div class="message tooltip" title="commit5" style="white-space:normal">commit5</div>""")
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
236
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
237 response.mustcontain("""<a href="/%s/changeset/%s">r2:%s</a>""" % (repo1.repo_name, cs2.raw_id, cs2.short_id))
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
238 response.mustcontain("""<a href="/%s/changeset/%s">r3:%s</a>""" % (repo1.repo_name, cs3.raw_id, cs3.short_id))
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
239 response.mustcontain("""<a href="/%s/changeset/%s">r4:%s</a>""" % (repo1.repo_name, cs4.raw_id, cs4.short_id))
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
240 ## files
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
241 response.mustcontain("""#C--826e8142e6ba">file1</a>""")
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
242
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
243 def test_compare_cherry_pick_changesets_from_top(self):
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
244 # repo1:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
245 # cs0:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
246 # cs1:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
247 # repo1-fork- in which we will cherry pick bottom changesets
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
248 # cs0:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
249 # cs1:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
250 # cs2:
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
251 # cs3: x
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
252 # cs4: x
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
253 # cs5: x
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
254 #
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
255 #make repo1, and cs1+cs2
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
256 self.log_user()
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
257 repo1 = RepoModel().create_repo(repo_name='repo1', repo_type='hg',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
258 description='diff-test',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
259 owner=TEST_USER_ADMIN_LOGIN)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
260 Session().commit()
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
261 self.r1_id = repo1.repo_id
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
262
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
263 #commit something !
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
264 cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
265 message='commit1', vcs_type='hg', parent=None,
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
266 newfile=True)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
267 cs1 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
268 message='commit2', vcs_type='hg', parent=cs0)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
269 #fork this repo
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
270 repo2 = _fork_repo('repo1-fork', 'hg', parent='repo1')
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
271 self.r2_id = repo2.repo_id
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
272 #now make cs3-6
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
273 cs2 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
274 message='commit3', vcs_type='hg', parent=cs1)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
275 cs3 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
276 message='commit4', vcs_type='hg', parent=cs2)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
277 cs4 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
278 message='commit5', vcs_type='hg', parent=cs3)
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
279 cs5 = _commit_change(repo1.repo_name, filename='file1', content='line1\nline2\nline3\nline4\nline5\nline6\n',
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
280 message='commit6', vcs_type='hg', parent=cs4)
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
281 response = self.app.get(url(controller='compare', action='index',
3484
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
282 repo_name=repo1.repo_name,
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
283 org_ref_type="rev",
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
284 org_ref=cs2.short_id, # parent of cs3, not in repo2
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
285 other_ref_type="rev",
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
286 other_ref=cs5.short_id,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
287 merge='1',
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
288 ))
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
289
3484
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3442
diff changeset
290 response.mustcontain('%s@%s -&gt; %s@%s' % (repo1.repo_name, cs2.short_id, repo1.repo_name, cs5.short_id))
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
291 response.mustcontain("""Showing 3 commits""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
292 response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
293
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
294 response.mustcontain("""<div class="message tooltip" title="commit4" style="white-space:normal">commit4</div>""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
295 response.mustcontain("""<div class="message tooltip" title="commit5" style="white-space:normal">commit5</div>""")
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
296 response.mustcontain("""<div class="message tooltip" title="commit6" style="white-space:normal">commit6</div>""")
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
297
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
298 response.mustcontain("""<a href="/%s/changeset/%s">r3:%s</a>""" % (repo1.repo_name, cs3.raw_id, cs3.short_id))
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
299 response.mustcontain("""<a href="/%s/changeset/%s">r4:%s</a>""" % (repo1.repo_name, cs4.raw_id, cs4.short_id))
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
300 response.mustcontain("""<a href="/%s/changeset/%s">r5:%s</a>""" % (repo1.repo_name, cs5.raw_id, cs5.short_id))
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
301 ## files
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
302 response.mustcontain("""#C--826e8142e6ba">file1</a>""")
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
303
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
304 def test_compare_cherry_pick_changeset_mixed_branches(self):
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
305 """
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
306
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
307 """
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
308 pass
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
309 #TODO write this tastecase
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
310
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
311 def test_compare_remote_branches_hg(self):
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
312 self.log_user()
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
313
3380
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
314 repo2 = _fork_repo(HG_FORK, 'hg')
01fe360a66c0 fixed pull-requests with cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents: 3379
diff changeset
315 self.r2_id = repo2.repo_id
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
316 rev1 = '56349e29c2af'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
317 rev2 = '7d4bc8ec6be5'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
318
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
319 response = self.app.get(url(controller='compare', action='index',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
320 repo_name=HG_REPO,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
321 org_ref_type="rev",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
322 org_ref=rev1,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
323 other_ref_type="rev",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
324 other_ref=rev2,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
325 other_repo=HG_FORK,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
326 merge='1',
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
327 ))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
328 response.mustcontain('%s@%s -&gt; %s@%s' % (HG_REPO, rev1, HG_FORK, rev2))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
329 ## outgoing changesets between those revisions
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
330
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
331 response.mustcontain("""<a href="/%s/changeset/2dda4e345facb0ccff1a191052dd1606dba6781d">r4:2dda4e345fac</a>""" % (HG_FORK))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
332 response.mustcontain("""<a href="/%s/changeset/6fff84722075f1607a30f436523403845f84cd9e">r5:6fff84722075</a>""" % (HG_FORK))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
333 response.mustcontain("""<a href="/%s/changeset/7d4bc8ec6be56c0f10425afb40b6fc315a4c25e7">r6:%s</a>""" % (HG_FORK, rev2))
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
334
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
335 ## files
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
336 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s?other_repo=%s&amp;merge=1#C--9c390eb52cd6">vcs/backends/hg.py</a>""" % (HG_REPO, rev1, rev2, HG_FORK))
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
337 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s?other_repo=%s&amp;merge=1#C--41b41c1f2796">vcs/backends/__init__.py</a>""" % (HG_REPO, rev1, rev2, HG_FORK))
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
338 response.mustcontain("""<a href="/%s/compare/rev@%s...rev@%s?other_repo=%s&amp;merge=1#C--2f574d260608">vcs/backends/base.py</a>""" % (HG_REPO, rev1, rev2, HG_FORK))
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
339
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
340 def test_org_repo_new_commits_after_forking_simple_diff(self):
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
341 self.log_user()
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
342
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
343 repo1 = RepoModel().create_repo(repo_name='one', repo_type='hg',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
344 description='diff-test',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
345 owner=TEST_USER_ADMIN_LOGIN)
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
346
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
347 Session().commit()
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
348 self.r1_id = repo1.repo_id
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
349 r1_name = repo1.repo_name
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
350
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
351 #commit something initially !
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
352 cs0 = ScmModel().create_node(
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
353 repo=repo1.scm_instance, repo_name=r1_name,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
354 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
355 author=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
356 message='commit1',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
357 content='line1',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
358 f_path='file1'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
359 )
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
360 Session().commit()
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
361 self.assertEqual(repo1.scm_instance.revisions, [cs0.raw_id])
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
362 #fork the repo1
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
363 repo2 = RepoModel().create_repo(repo_name='one-fork', repo_type='hg',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
364 description='compare-test',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
365 clone_uri=repo1.repo_full_path,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
366 owner=TEST_USER_ADMIN_LOGIN, fork_of='one')
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
367 Session().commit()
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
368 self.assertEqual(repo2.scm_instance.revisions, [cs0.raw_id])
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
369 self.r2_id = repo2.repo_id
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
370 r2_name = repo2.repo_name
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
371
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
372 #make 3 new commits in fork
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
373 cs1 = ScmModel().create_node(
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
374 repo=repo2.scm_instance, repo_name=r2_name,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
375 cs=repo2.scm_instance[-1], user=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
376 author=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
377 message='commit1-fork',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
378 content='file1-line1-from-fork',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
379 f_path='file1-fork'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
380 )
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
381 cs2 = ScmModel().create_node(
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
382 repo=repo2.scm_instance, repo_name=r2_name,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
383 cs=cs1, user=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
384 author=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
385 message='commit2-fork',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
386 content='file2-line1-from-fork',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
387 f_path='file2-fork'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
388 )
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
389 cs3 = ScmModel().create_node(
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
390 repo=repo2.scm_instance, repo_name=r2_name,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
391 cs=cs2, user=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
392 author=TEST_USER_ADMIN_LOGIN,
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
393 message='commit3-fork',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
394 content='file3-line1-from-fork',
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
395 f_path='file3-fork'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
396 )
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
397
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
398 #compare !
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
399 rev1 = 'default'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
400 rev2 = 'default'
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
401
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
402 response = self.app.get(url(controller='compare', action='index',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
403 repo_name=r2_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
404 org_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
405 org_ref=rev1,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
406 other_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
407 other_ref=rev2,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
408 other_repo=r1_name,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
409 merge='1',
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
410 ))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
411 response.mustcontain('%s@%s -&gt; %s@%s' % (r2_name, rev1, r1_name, rev2))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
412 response.mustcontain('No files')
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
413 response.mustcontain('No changesets')
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
414
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
415 #add new commit into parent !
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
416 cs0 = ScmModel().create_node(
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
417 repo=repo1.scm_instance, repo_name=r1_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
418 cs=EmptyChangeset(alias='hg'), user=TEST_USER_ADMIN_LOGIN,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
419 author=TEST_USER_ADMIN_LOGIN,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
420 message='commit2-parent',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
421 content='line1-added-after-fork',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
422 f_path='file2'
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
423 )
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
424 #compare !
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
425 rev1 = 'default'
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
426 rev2 = 'default'
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
427 response = self.app.get(url(controller='compare', action='index',
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
428 repo_name=r2_name,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
429 org_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
430 org_ref=rev1,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
431 other_ref_type="branch",
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
432 other_ref=rev2,
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
433 other_repo=r1_name,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
434 merge='1',
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
435 ))
3331
0379e15f0b85 added some failing tests for compare using cherry pick changesets, to be fixed later
Marcin Kuzminski <marcin@python-works.com>
parents: 3322
diff changeset
436
3379
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
437 response.mustcontain('%s@%s -&gt; %s@%s' % (r2_name, rev1, r1_name, rev2))
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
438
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
439 response.mustcontain("""commit2-parent""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
440 response.mustcontain("""1 file changed with 1 insertions and 0 deletions""")
8171dfafb5db some tests fixes for compare view
Marcin Kuzminski <marcin@python-works.com>
parents: 3338
diff changeset
441 response.mustcontain("""line1-added-after-fork""")