# HG changeset patch # User Marcin Kuzminski # Date 1353096590 -3600 # Node ID f0e19116f154e5ee32670a9e02e6168d693a37fd # Parent 6e76b4892d727f60a1406db6a8152841cce5457d fixed file history tests diff -r 6e76b4892d72 -r f0e19116f154 rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py Thu Nov 15 00:57:52 2012 +0100 +++ b/rhodecode/controllers/files.py Fri Nov 16 21:09:50 2012 +0100 @@ -551,8 +551,6 @@ :param changesets: if passed don't calculate history and take changesets defined in this list """ - import time - s = time.time() # calculate history based on tip tip_cs = c.rhodecode_repo.get_changeset() if changesets is None: @@ -561,7 +559,6 @@ except (NodeDoesNotExistError, ChangesetError): #this node is not present at tip ! changesets = cs.get_file_history(f_path) - print time.time()-s hist_l = [] changesets_group = ([], _("Changesets")) @@ -571,9 +568,8 @@ for chs in changesets: #_branch = '(%s)' % chs.branch if _hg else '' _branch = chs.branch - n_desc = 'r%s:%s %s' % (chs.revision, chs.short_id, _branch) + n_desc = 'r%s:%s (%s)' % (chs.revision, chs.short_id, _branch) changesets_group[0].append((chs.raw_id, n_desc,)) - print time.time()-s hist_l.append(changesets_group) for name, chs in c.rhodecode_repo.branches.items(): @@ -583,7 +579,7 @@ for name, chs in c.rhodecode_repo.tags.items(): tags_group[0].append((chs, name),) hist_l.append(tags_group) - print time.time()-s + return hist_l, changesets @LoginRequired() diff -r 6e76b4892d72 -r f0e19116f154 rhodecode/tests/functional/test_files.py --- a/rhodecode/tests/functional/test_files.py Thu Nov 15 00:57:52 2012 +0100 +++ b/rhodecode/tests/functional/test_files.py Fri Nov 16 21:09:50 2012 +0100 @@ -73,6 +73,22 @@ revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', f_path='vcs/nodes.py')) + response.mustcontain("""
Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. +In addition some other __str__ are unicode as well +Added test for unicode +Improved test to clone into uniq repository. +removed extra unicode conversion in diff.
+""") + + response.mustcontain("""branch: default""") + + def test_file_source_history(self): + self.log_user() + response = self.app.get(url(controller='files', action='history', + repo_name=HG_REPO, + revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', + f_path='vcs/nodes.py'), + extra_environ={'HTTP_X_PARTIAL_XHR': '1'},) #test or history response.mustcontain(""" @@ -123,15 +139,6 @@ """) - response.mustcontain("""
Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. -In addition some other __str__ are unicode as well -Added test for unicode -Improved test to clone into uniq repository. -removed extra unicode conversion in diff.
-""") - - response.mustcontain("""branch: default""") - def test_file_annotation(self): self.log_user() response = self.app.get(url(controller='files', action='index', @@ -140,6 +147,16 @@ f_path='vcs/nodes.py', annotate=True)) + response.mustcontain("""branch: default""") + + def test_file_annotation_history(self): + self.log_user() + response = self.app.get(url(controller='files', action='history', + repo_name=HG_REPO, + revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', + f_path='vcs/nodes.py', + annotate=True), + extra_environ={'HTTP_X_PARTIAL_XHR': '1'}) response.mustcontain(""" @@ -189,8 +206,6 @@ """) - response.mustcontain("""branch: default""") - def test_file_annotation_git(self): self.log_user() response = self.app.get(url(controller='files', action='index',