annotate kallithea/tests/functional/test_compare_local.py @ 8687:5e46f73f0d1c

model: always import the whole db module - drop "from" imports
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 12 Oct 2020 11:12:37 +0200
parents e527cc2ce8dc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3797
diff changeset
1 # -*- coding: utf-8 -*-
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
2 from kallithea.tests import base
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3
7811
0a277465fddf scripts: initial run of import cleanup using isort
Mads Kiilerich <mads@kiilerich.com>
parents: 6996
diff changeset
4
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
5 class TestCompareController(base.TestController):
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 def test_compare_tag_hg(self):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 self.log_user()
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3304
diff changeset
9 tag1 = 'v0.1.2'
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3304
diff changeset
10 tag2 = 'v0.1.3'
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
11 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
12 repo_name=base.HG_REPO,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 org_ref_type="tag",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
14 org_ref_name=tag1,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 other_ref_type="tag",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
16 other_ref_name=tag2,
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3304
diff changeset
17 ), status=200)
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
18 response.mustcontain('%s@%s' % (base.HG_REPO, tag1))
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
19 response.mustcontain('%s@%s' % (base.HG_REPO, tag2))
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3304
diff changeset
20
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 ## outgoing changesets between tags
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
22 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/c5ddebc06eaaba3010c2d66ea6ec9d074eb0f678">r112:c5ddebc06eaa</a>''' % base.HG_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
23 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/70d4cef8a37657ee4cf5aabb3bd9f68879769816">r115:70d4cef8a376</a>''' % base.HG_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
24 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/9749bfbfc0d2eba208d7947de266303b67c87cda">r116:9749bfbfc0d2</a>''' % base.HG_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
25 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/41fda979f02fda216374bf8edac4e83f69e7581c">r117:41fda979f02f</a>''' % base.HG_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
26 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/bb1a3ab98cc45cb934a77dcabf87a5a598b59e97">r118:bb1a3ab98cc4</a>''' % base.HG_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
27 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/36e0fc9d2808c5022a24f49d6658330383ed8666">r119:36e0fc9d2808</a>''' % base.HG_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
28 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">r120:17544fbfcd33</a>''' % base.HG_REPO)
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 response.mustcontain('11 files changed with 94 insertions and 64 deletions')
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 ## files diff
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
33 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
34 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
35 <i class="icon-diff-added"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
36 <a href="#C--1c5cf9e91c12">docs/api/utils/index.rst</a>
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
37 </span>''')
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
38 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
39 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
40 <i class="icon-diff-added"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
41 <a href="#C--e3305437df55">test_and_report.sh</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
42 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
43 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
44 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
45 <a href="#C--c8e92ef85cd1">.hgignore</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
46 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
47 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
48 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
49 <a href="#C--6e08b694d687">.hgtags</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
50 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
51 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
52 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
53 <a href="#C--2c14b00f3393">docs/api/index.rst</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
54 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
55 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
56 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
57 <a href="#C--430ccbc82bdf">vcs/__init__.py</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
58 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
59 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
60 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
61 <a href="#C--9c390eb52cd6">vcs/backends/hg.py</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
62 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
63 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
64 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
65 <a href="#C--ebb592c595c0">vcs/utils/__init__.py</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
66 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
67 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
68 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
69 <a href="#C--7abc741b5052">vcs/utils/annotate.py</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
70 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
71 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
72 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
73 <a href="#C--2ef0ef106c56">vcs/utils/diffs.py</a>''')
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
74 response.mustcontain(
6979
b66e4d720198 templates: change .node elements to <span>
domruf <dominikruf@gmail.com>
parents: 6864
diff changeset
75 '''<span class="node">
6980
ceaa65df5add diff: use fontello icon-diff-* names in generated html
domruf <dominikruf@gmail.com>
parents: 6979
diff changeset
76 <i class="icon-diff-modified"></i>
6192
72acb38da217 diff: minor cleanups
Mads Kiilerich <madski@unity3d.com>
parents: 6123
diff changeset
77 <a href="#C--3150cb87d4b7">vcs/utils/lazy.py</a>''')
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
78
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
79 def test_compare_tag_git(self):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
80 self.log_user()
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
81 tag1 = 'v0.1.2'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
82 tag2 = 'v0.1.3'
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
83 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
84 repo_name=base.GIT_REPO,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
85 org_ref_type="tag",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
86 org_ref_name=tag1,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
87 other_ref_type="tag",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
88 other_ref_name=tag2,
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3304
diff changeset
89 ), status=200)
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
90 response.mustcontain('%s@%s' % (base.GIT_REPO, tag1))
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
91 response.mustcontain('%s@%s' % (base.GIT_REPO, tag2))
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
92
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
93 ## outgoing changesets between tags
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
94 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/794bbdd31545c199f74912709ea350dedcd189a2">r113:794bbdd31545</a>''' % base.GIT_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
95 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/e36d8c5025329bdd4212bd53d4ed8a70ff44985f">r115:e36d8c502532</a>''' % base.GIT_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
96 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/5c9ff4f6d7508db0e72b1d2991c357d0d8e07af2">r116:5c9ff4f6d750</a>''' % base.GIT_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
97 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/b7187fa2b8c1d773ec35e9dee12f01f74808c879">r117:b7187fa2b8c1</a>''' % base.GIT_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
98 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/5f3b74262014a8de2dc7dade1152de9fd0c8efef">r118:5f3b74262014</a>''' % base.GIT_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
99 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/17438a11f72b93f56d0e08e7d1fa79a378578a82">r119:17438a11f72b</a>''' % base.GIT_REPO)
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
100 response.mustcontain('''<a class="changeset_hash" href="/%s/changeset/5a3a8fb005554692b16e21dee62bf02667d8dc3e">r120:5a3a8fb00555</a>''' % base.GIT_REPO)
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
101
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
102 response.mustcontain('11 files changed with 94 insertions and 64 deletions')
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
103
6864
7691290837d2 codingstyle: trivial whitespace fixes
Lars Kruse <devel@sumpfralle.de>
parents: 6542
diff changeset
104 # files
4362
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
105 response.mustcontain('''<a href="#C--1c5cf9e91c12">docs/api/utils/index.rst</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
106 response.mustcontain('''<a href="#C--e3305437df55">test_and_report.sh</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
107 response.mustcontain('''<a href="#C--c8e92ef85cd1">.hgignore</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
108 response.mustcontain('''<a href="#C--6e08b694d687">.hgtags</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
109 response.mustcontain('''<a href="#C--2c14b00f3393">docs/api/index.rst</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
110 response.mustcontain('''<a href="#C--430ccbc82bdf">vcs/__init__.py</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
111 response.mustcontain('''<a href="#C--9c390eb52cd6">vcs/backends/hg.py</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
112 response.mustcontain('''<a href="#C--ebb592c595c0">vcs/utils/__init__.py</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
113 response.mustcontain('''<a href="#C--7abc741b5052">vcs/utils/annotate.py</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
114 response.mustcontain('''<a href="#C--2ef0ef106c56">vcs/utils/diffs.py</a>''')
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
115 response.mustcontain('''<a href="#C--3150cb87d4b7">vcs/utils/lazy.py</a>''')
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
116
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
117 def test_index_branch_hg(self):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
118 self.log_user()
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
119 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
120 repo_name=base.HG_REPO,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
121 org_ref_type="branch",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
122 org_ref_name='default',
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
123 other_ref_type="branch",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
124 other_ref_name='default',
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
125 ))
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
126
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
127 response.mustcontain('%s@default' % (base.HG_REPO))
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
128 response.mustcontain('%s@default' % (base.HG_REPO))
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
129 # branch are equal
6996
647e7e0ce812 less: use bootstrap class .text-muted instead of custom one
domruf <dominikruf@gmail.com>
parents: 6980
diff changeset
130 response.mustcontain('<span class="text-muted">No files</span>')
647e7e0ce812 less: use bootstrap class .text-muted instead of custom one
domruf <dominikruf@gmail.com>
parents: 6980
diff changeset
131 response.mustcontain('<span class="text-muted">No changesets</span>')
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
132
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
133 def test_index_branch_git(self):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
134 self.log_user()
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
135 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
136 repo_name=base.GIT_REPO,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
137 org_ref_type="branch",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
138 org_ref_name='master',
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
139 other_ref_type="branch",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
140 other_ref_name='master',
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
141 ))
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
142
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
143 response.mustcontain('%s@master' % (base.GIT_REPO))
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
144 response.mustcontain('%s@master' % (base.GIT_REPO))
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
145 # branch are equal
6996
647e7e0ce812 less: use bootstrap class .text-muted instead of custom one
domruf <dominikruf@gmail.com>
parents: 6980
diff changeset
146 response.mustcontain('<span class="text-muted">No files</span>')
647e7e0ce812 less: use bootstrap class .text-muted instead of custom one
domruf <dominikruf@gmail.com>
parents: 6980
diff changeset
147 response.mustcontain('<span class="text-muted">No changesets</span>')
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
148
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
149 def test_compare_revisions_hg(self):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
150 self.log_user()
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
151 rev1 = 'b986218ba1c9'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
152 rev2 = '3d8f361e72ab'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
153
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
154 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
155 repo_name=base.HG_REPO,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
156 org_ref_type="rev",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
157 org_ref_name=rev1,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
158 other_ref_type="rev",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
159 other_ref_name=rev2,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
160 ))
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
161 response.mustcontain('%s@%s' % (base.HG_REPO, rev1))
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
162 response.mustcontain('%s@%s' % (base.HG_REPO, rev2))
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3797
diff changeset
163
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
164 ## outgoing changesets between those revisions
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
165 response.mustcontain("""<a class="changeset_hash" href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (base.HG_REPO, rev2))
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
166
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
167 response.mustcontain('1 file changed with 7 insertions and 0 deletions')
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
168 ## files
4362
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
169 response.mustcontain("""<a href="#C--c8e92ef85cd1">.hgignore</a>""")
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
170
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
171 def test_compare_revisions_git(self):
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
172 self.log_user()
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
173 rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
174 rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557'
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
175
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
176 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
177 repo_name=base.GIT_REPO,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
178 org_ref_type="rev",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
179 org_ref_name=rev1,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
180 other_ref_type="rev",
4291
c2e3923eebe4 compare: consistent naming: _ref is a tuple, _ref_type is the type, _ref_name is symbolic name, _rev is the revision
Mads Kiilerich <madski@unity3d.com>
parents: 4187
diff changeset
181 other_ref_name=rev2,
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
182 ))
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
183 response.mustcontain('%s@%s' % (base.GIT_REPO, rev1))
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
184 response.mustcontain('%s@%s' % (base.GIT_REPO, rev2))
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3797
diff changeset
185
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
186 ## outgoing changesets between those revisions
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
187 response.mustcontain("""<a class="changeset_hash" href="/%s/changeset/38b5fe81f109cb111f549bfe9bb6b267e10bc557">r1:%s</a>""" % (base.GIT_REPO, rev2[:12]))
3023
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
188 response.mustcontain('1 file changed with 7 insertions and 0 deletions')
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
189
c2a206162062 Basic implementation of cherry picking changesets
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
190 ## files
4362
79eb3211cda1 compare: links from file list to file diff should just use anchor
Mads Kiilerich <madski@unity3d.com>
parents: 4291
diff changeset
191 response.mustcontain("""<a href="#C--c8e92ef85cd1">.hgignore</a>""")
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
192
6542
62ac1470b748 pullrequests: rename "as_form" to something more descriptive
Søren Løvborg <sorenl@unity3d.com>
parents: 6302
diff changeset
193 def test_compare_revisions_hg_is_ajax_preview(self):
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
194 self.log_user()
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
195 rev1 = 'b986218ba1c9'
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
196 rev2 = '3d8f361e72ab'
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
197
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
198 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
199 repo_name=base.HG_REPO,
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
200 org_ref_type="rev",
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
201 org_ref_name=rev1,
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
202 other_ref_type="rev",
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
203 other_ref_name=rev2,
6542
62ac1470b748 pullrequests: rename "as_form" to something more descriptive
Søren Løvborg <sorenl@unity3d.com>
parents: 6302
diff changeset
204 is_ajax_preview=True,
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
205 ),
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
206 extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
207
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
208 ## outgoing changesets between those revisions
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
209 response.mustcontain("""<a class="changeset_hash" href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (base.HG_REPO, rev2))
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
210
6302
84eb5b7b1bac pullrequests: prevent creation of invalid pull requests, empty or unrelated or criss cross
Mads Kiilerich <madski@unity3d.com>
parents: 6217
diff changeset
211 response.mustcontain('Merge Ancestor')
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
212 response.mustcontain("""<a class="changeset_hash" href="/%s/changeset/b986218ba1c9b0d6a259fac9b050b1724ed8e545">%s</a>""" % (base.HG_REPO, rev1))
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
213
6542
62ac1470b748 pullrequests: rename "as_form" to something more descriptive
Søren Løvborg <sorenl@unity3d.com>
parents: 6302
diff changeset
214 def test_compare_revisions_git_is_ajax_preview(self):
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
215 self.log_user()
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
216 rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3'
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
217 rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557'
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
218
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
219 response = self.app.get(base.url('compare_url',
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
220 repo_name=base.GIT_REPO,
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
221 org_ref_type="rev",
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
222 org_ref_name=rev1,
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
223 other_ref_type="rev",
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
224 other_ref_name=rev2,
6542
62ac1470b748 pullrequests: rename "as_form" to something more descriptive
Søren Løvborg <sorenl@unity3d.com>
parents: 6302
diff changeset
225 is_ajax_preview=True,
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
226 ),
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
227 extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
228 ## outgoing changesets between those revisions
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
229 response.mustcontain("""<a class="changeset_hash" href="/%s/changeset/38b5fe81f109cb111f549bfe9bb6b267e10bc557">r1:%s</a>""" % (base.GIT_REPO, rev2[:12]))
4394
dc4a768927eb pull requests: fix same git repository pull-request issue
Takumi IINO <trot.thunder@gmail.com>
parents: 4362
diff changeset
230
6302
84eb5b7b1bac pullrequests: prevent creation of invalid pull requests, empty or unrelated or criss cross
Mads Kiilerich <madski@unity3d.com>
parents: 6217
diff changeset
231 response.mustcontain('Merge Ancestor')
8109
e527cc2ce8dc cleanup: get rid of most "import *"
Mads Kiilerich <mads@kiilerich.com>
parents: 7811
diff changeset
232 response.mustcontain("""<a class="changeset_hash" href="/%s/changeset/c1214f7e79e02fc37156ff215cd71275450cffc3">%s</a>""" % (base.GIT_REPO, rev1[:12]))