comparison rhodecode/tests/functional/test_compare_local.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents d7488551578e
children 7e5f8c12a3fc
comparison
equal deleted inserted replaced
4115:8b7294a804a0 4116:ffd45b185016
1 # -*- coding: utf-8 -*-
1 from rhodecode.tests import * 2 from rhodecode.tests import *
2 from rhodecode.model.repo import RepoModel
3 from rhodecode.model.meta import Session
4 from rhodecode.model.db import Repository
5 from rhodecode.model.scm import ScmModel
6 from rhodecode.lib.vcs.backends.base import EmptyChangeset
7
8 3
9 class TestCompareController(TestController): 4 class TestCompareController(TestController):
10 5
11 def test_compare_tag_hg(self): 6 def test_compare_tag_hg(self):
12 self.log_user() 7 self.log_user()
13 tag1 = 'v0.1.2' 8 tag1 = 'v0.1.2'
14 tag2 = 'v0.1.3' 9 tag2 = 'v0.1.3'
15 response = self.app.get(url(controller='compare', action='index', 10 response = self.app.get(url('compare_url',
16 repo_name=HG_REPO, 11 repo_name=HG_REPO,
17 org_ref_type="tag", 12 org_ref_type="tag",
18 org_ref=tag1, 13 org_ref=tag1,
19 other_ref_type="tag", 14 other_ref_type="tag",
20 other_ref=tag2, 15 other_ref=tag2,
21 ), status=200) 16 ), status=200)
22 response.mustcontain('%s@%s -&gt; %s@%s' % (HG_REPO, tag1, HG_REPO, tag2)) 17 response.mustcontain('%s@%s' % (HG_REPO, tag1))
18 response.mustcontain('%s@%s' % (HG_REPO, tag2))
23 19
24 ## outgoing changesets between tags 20 ## outgoing changesets between tags
25 response.mustcontain('''<a href="/%s/changeset/c5ddebc06eaaba3010c2d66ea6ec9d074eb0f678">r112:c5ddebc06eaa</a>''' % HG_REPO) 21 response.mustcontain('''<a href="/%s/changeset/c5ddebc06eaaba3010c2d66ea6ec9d074eb0f678">r112:c5ddebc06eaa</a>''' % HG_REPO)
26 response.mustcontain('''<a href="/%s/changeset/70d4cef8a37657ee4cf5aabb3bd9f68879769816">r115:70d4cef8a376</a>''' % HG_REPO) 22 response.mustcontain('''<a href="/%s/changeset/70d4cef8a37657ee4cf5aabb3bd9f68879769816">r115:70d4cef8a376</a>''' % HG_REPO)
27 response.mustcontain('''<a href="/%s/changeset/9749bfbfc0d2eba208d7947de266303b67c87cda">r116:9749bfbfc0d2</a>''' % HG_REPO) 23 response.mustcontain('''<a href="/%s/changeset/9749bfbfc0d2eba208d7947de266303b67c87cda">r116:9749bfbfc0d2</a>''' % HG_REPO)
47 43
48 def test_compare_tag_git(self): 44 def test_compare_tag_git(self):
49 self.log_user() 45 self.log_user()
50 tag1 = 'v0.1.2' 46 tag1 = 'v0.1.2'
51 tag2 = 'v0.1.3' 47 tag2 = 'v0.1.3'
52 response = self.app.get(url(controller='compare', action='index', 48 response = self.app.get(url('compare_url',
53 repo_name=GIT_REPO, 49 repo_name=GIT_REPO,
54 org_ref_type="tag", 50 org_ref_type="tag",
55 org_ref=tag1, 51 org_ref=tag1,
56 other_ref_type="tag", 52 other_ref_type="tag",
57 other_ref=tag2, 53 other_ref=tag2,
58 ), status=200) 54 ), status=200)
59 response.mustcontain('%s@%s -&gt; %s@%s' % (GIT_REPO, tag1, GIT_REPO, tag2)) 55 response.mustcontain('%s@%s' % (GIT_REPO, tag1))
56 response.mustcontain('%s@%s' % (GIT_REPO, tag2))
60 57
61 ## outgoing changesets between tags 58 ## outgoing changesets between tags
62 response.mustcontain('''<a href="/%s/changeset/794bbdd31545c199f74912709ea350dedcd189a2">r113:794bbdd31545</a>''' % GIT_REPO) 59 response.mustcontain('''<a href="/%s/changeset/794bbdd31545c199f74912709ea350dedcd189a2">r113:794bbdd31545</a>''' % GIT_REPO)
63 response.mustcontain('''<a href="/%s/changeset/e36d8c5025329bdd4212bd53d4ed8a70ff44985f">r115:e36d8c502532</a>''' % GIT_REPO) 60 response.mustcontain('''<a href="/%s/changeset/e36d8c5025329bdd4212bd53d4ed8a70ff44985f">r115:e36d8c502532</a>''' % GIT_REPO)
64 response.mustcontain('''<a href="/%s/changeset/5c9ff4f6d7508db0e72b1d2991c357d0d8e07af2">r116:5c9ff4f6d750</a>''' % GIT_REPO) 61 response.mustcontain('''<a href="/%s/changeset/5c9ff4f6d7508db0e72b1d2991c357d0d8e07af2">r116:5c9ff4f6d750</a>''' % GIT_REPO)
82 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--2ef0ef106c56">vcs/utils/diffs.py</a>''' % (GIT_REPO, tag1, tag2)) 79 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--2ef0ef106c56">vcs/utils/diffs.py</a>''' % (GIT_REPO, tag1, tag2))
83 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--3150cb87d4b7">vcs/utils/lazy.py</a>''' % (GIT_REPO, tag1, tag2)) 80 response.mustcontain('''<a href="/%s/compare/tag@%s...tag@%s#C--3150cb87d4b7">vcs/utils/lazy.py</a>''' % (GIT_REPO, tag1, tag2))
84 81
85 def test_index_branch_hg(self): 82 def test_index_branch_hg(self):
86 self.log_user() 83 self.log_user()
87 response = self.app.get(url(controller='compare', action='index', 84 response = self.app.get(url('compare_url',
88 repo_name=HG_REPO, 85 repo_name=HG_REPO,
89 org_ref_type="branch", 86 org_ref_type="branch",
90 org_ref='default', 87 org_ref='default',
91 other_ref_type="branch", 88 other_ref_type="branch",
92 other_ref='default', 89 other_ref='default',
93 )) 90 ))
94 91
95 response.mustcontain('%s@default -&gt; %s@default' % (HG_REPO, HG_REPO)) 92 response.mustcontain('%s@default' % (HG_REPO))
93 response.mustcontain('%s@default' % (HG_REPO))
96 # branch are equal 94 # branch are equal
97 response.mustcontain('<span class="empty_data">No files</span>') 95 response.mustcontain('<span class="empty_data">No files</span>')
98 response.mustcontain('<span class="empty_data">No changesets</span>') 96 response.mustcontain('<span class="empty_data">No changesets</span>')
99 97
100 def test_index_branch_git(self): 98 def test_index_branch_git(self):
101 self.log_user() 99 self.log_user()
102 response = self.app.get(url(controller='compare', action='index', 100 response = self.app.get(url('compare_url',
103 repo_name=GIT_REPO, 101 repo_name=GIT_REPO,
104 org_ref_type="branch", 102 org_ref_type="branch",
105 org_ref='master', 103 org_ref='master',
106 other_ref_type="branch", 104 other_ref_type="branch",
107 other_ref='master', 105 other_ref='master',
108 )) 106 ))
109 107
110 response.mustcontain('%s@master -&gt; %s@master' % (GIT_REPO, GIT_REPO)) 108 response.mustcontain('%s@master' % (GIT_REPO))
109 response.mustcontain('%s@master' % (GIT_REPO))
111 # branch are equal 110 # branch are equal
112 response.mustcontain('<span class="empty_data">No files</span>') 111 response.mustcontain('<span class="empty_data">No files</span>')
113 response.mustcontain('<span class="empty_data">No changesets</span>') 112 response.mustcontain('<span class="empty_data">No changesets</span>')
114 113
115 def test_compare_revisions_hg(self): 114 def test_compare_revisions_hg(self):
116 self.log_user() 115 self.log_user()
117 rev1 = 'b986218ba1c9' 116 rev1 = 'b986218ba1c9'
118 rev2 = '3d8f361e72ab' 117 rev2 = '3d8f361e72ab'
119 118
120 response = self.app.get(url(controller='compare', action='index', 119 response = self.app.get(url('compare_url',
121 repo_name=HG_REPO, 120 repo_name=HG_REPO,
122 org_ref_type="rev", 121 org_ref_type="rev",
123 org_ref=rev1, 122 org_ref=rev1,
124 other_ref_type="rev", 123 other_ref_type="rev",
125 other_ref=rev2, 124 other_ref=rev2,
126 )) 125 ))
127 response.mustcontain('%s@%s -&gt; %s@%s' % (HG_REPO, rev1, HG_REPO, rev2)) 126 response.mustcontain('%s@%s' % (HG_REPO, rev1))
127 response.mustcontain('%s@%s' % (HG_REPO, rev2))
128
128 ## outgoing changesets between those revisions 129 ## outgoing changesets between those revisions
129 response.mustcontain("""<a href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (HG_REPO, rev2)) 130 response.mustcontain("""<a href="/%s/changeset/3d8f361e72ab303da48d799ff1ac40d5ac37c67e">r1:%s</a>""" % (HG_REPO, rev2))
130 131
131 response.mustcontain('1 file changed with 7 insertions and 0 deletions') 132 response.mustcontain('1 file changed with 7 insertions and 0 deletions')
132 ## files 133 ## files
135 def test_compare_revisions_git(self): 136 def test_compare_revisions_git(self):
136 self.log_user() 137 self.log_user()
137 rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3' 138 rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3'
138 rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557' 139 rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557'
139 140
140 response = self.app.get(url(controller='compare', action='index', 141 response = self.app.get(url('compare_url',
141 repo_name=GIT_REPO, 142 repo_name=GIT_REPO,
142 org_ref_type="rev", 143 org_ref_type="rev",
143 org_ref=rev1, 144 org_ref=rev1,
144 other_ref_type="rev", 145 other_ref_type="rev",
145 other_ref=rev2, 146 other_ref=rev2,
146 )) 147 ))
147 response.mustcontain('%s@%s -&gt; %s@%s' % (GIT_REPO, rev1, GIT_REPO, rev2)) 148 response.mustcontain('%s@%s' % (GIT_REPO, rev1))
149 response.mustcontain('%s@%s' % (GIT_REPO, rev2))
150
148 ## outgoing changesets between those revisions 151 ## outgoing changesets between those revisions
149 response.mustcontain("""<a href="/%s/changeset/38b5fe81f109cb111f549bfe9bb6b267e10bc557">r1:%s</a>""" % (GIT_REPO, rev2[:12])) 152 response.mustcontain("""<a href="/%s/changeset/38b5fe81f109cb111f549bfe9bb6b267e10bc557">r1:%s</a>""" % (GIT_REPO, rev2[:12]))
150 response.mustcontain('1 file changed with 7 insertions and 0 deletions') 153 response.mustcontain('1 file changed with 7 insertions and 0 deletions')
151 154
152 ## files 155 ## files