vcs/utils/lazy.py''')
def test_compare_tag_git(self):
self.log_user()
tag1 = 'v0.1.2'
tag2 = 'v0.1.3'
response = self.app.get(url('compare_url',
repo_name=GIT_REPO,
org_ref_type="tag",
org_ref_name=tag1,
other_ref_type="tag",
other_ref_name=tag2,
), status=200)
response.mustcontain('%s@%s' % (GIT_REPO, tag1))
response.mustcontain('%s@%s' % (GIT_REPO, tag2))
## outgoing changesets between tags
response.mustcontain('''
r113:794bbdd31545''' % GIT_REPO)
response.mustcontain('''
r115:e36d8c502532''' % GIT_REPO)
response.mustcontain('''
r116:5c9ff4f6d750''' % GIT_REPO)
response.mustcontain('''
r117:b7187fa2b8c1''' % GIT_REPO)
response.mustcontain('''
r118:5f3b74262014''' % GIT_REPO)
response.mustcontain('''
r119:17438a11f72b''' % GIT_REPO)
response.mustcontain('''
r120:5a3a8fb00555''' % GIT_REPO)
response.mustcontain('11 files changed with 94 insertions and 64 deletions')
#files
response.mustcontain('''
docs/api/utils/index.rst''')
response.mustcontain('''
test_and_report.sh''')
response.mustcontain('''
.hgignore''')
response.mustcontain('''
.hgtags''')
response.mustcontain('''
docs/api/index.rst''')
response.mustcontain('''
vcs/__init__.py''')
response.mustcontain('''
vcs/backends/hg.py''')
response.mustcontain('''
vcs/utils/__init__.py''')
response.mustcontain('''
vcs/utils/annotate.py''')
response.mustcontain('''
vcs/utils/diffs.py''')
response.mustcontain('''
vcs/utils/lazy.py''')
def test_index_branch_hg(self):
self.log_user()
response = self.app.get(url('compare_url',
repo_name=HG_REPO,
org_ref_type="branch",
org_ref_name='default',
other_ref_type="branch",
other_ref_name='default',
))
response.mustcontain('%s@default' % (HG_REPO))
response.mustcontain('%s@default' % (HG_REPO))
# branch are equal
response.mustcontain('
No files')
response.mustcontain('
No changesets')
def test_index_branch_git(self):
self.log_user()
response = self.app.get(url('compare_url',
repo_name=GIT_REPO,
org_ref_type="branch",
org_ref_name='master',
other_ref_type="branch",
other_ref_name='master',
))
response.mustcontain('%s@master' % (GIT_REPO))
response.mustcontain('%s@master' % (GIT_REPO))
# branch are equal
response.mustcontain('
No files')
response.mustcontain('
No changesets')
def test_compare_revisions_hg(self):
self.log_user()
rev1 = 'b986218ba1c9'
rev2 = '3d8f361e72ab'
response = self.app.get(url('compare_url',
repo_name=HG_REPO,
org_ref_type="rev",
org_ref_name=rev1,
other_ref_type="rev",
other_ref_name=rev2,
))
response.mustcontain('%s@%s' % (HG_REPO, rev1))
response.mustcontain('%s@%s' % (HG_REPO, rev2))
## outgoing changesets between those revisions
response.mustcontain("""
r1:%s""" % (HG_REPO, rev2))
response.mustcontain('1 file changed with 7 insertions and 0 deletions')
## files
response.mustcontain("""
.hgignore""")
def test_compare_revisions_git(self):
self.log_user()
rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3'
rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557'
response = self.app.get(url('compare_url',
repo_name=GIT_REPO,
org_ref_type="rev",
org_ref_name=rev1,
other_ref_type="rev",
other_ref_name=rev2,
))
response.mustcontain('%s@%s' % (GIT_REPO, rev1))
response.mustcontain('%s@%s' % (GIT_REPO, rev2))
## outgoing changesets between those revisions
response.mustcontain("""
r1:%s""" % (GIT_REPO, rev2[:12]))
response.mustcontain('1 file changed with 7 insertions and 0 deletions')
## files
response.mustcontain("""
.hgignore""")
def test_compare_revisions_hg_as_form(self):
self.log_user()
rev1 = 'b986218ba1c9'
rev2 = '3d8f361e72ab'
response = self.app.get(url('compare_url',
repo_name=HG_REPO,
org_ref_type="rev",
org_ref_name=rev1,
other_ref_type="rev",
other_ref_name=rev2,
as_form=True,
),
extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
## outgoing changesets between those revisions
response.mustcontain("""
r1:%s""" % (HG_REPO, rev2))
response.mustcontain('Common ancestor')
response.mustcontain("""
%s""" % (HG_REPO, rev1))
def test_compare_revisions_git_as_form(self):
self.log_user()
rev1 = 'c1214f7e79e02fc37156ff215cd71275450cffc3'
rev2 = '38b5fe81f109cb111f549bfe9bb6b267e10bc557'
response = self.app.get(url('compare_url',
repo_name=GIT_REPO,
org_ref_type="rev",
org_ref_name=rev1,
other_ref_type="rev",
other_ref_name=rev2,
as_form=True,
),
extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
## outgoing changesets between those revisions
response.mustcontain("""
r1:%s""" % (GIT_REPO, rev2[:12]))
response.mustcontain('Common ancestor')
response.mustcontain("""
%s""" % (GIT_REPO, rev1[:12]))