Show More
@@ -551,8 +551,6 b' class FilesController(BaseRepoController' | |||
|
551 | 551 | :param changesets: if passed don't calculate history and take |
|
552 | 552 | changesets defined in this list |
|
553 | 553 | """ |
|
554 | import time | |
|
555 | s = time.time() | |
|
556 | 554 | # calculate history based on tip |
|
557 | 555 | tip_cs = c.rhodecode_repo.get_changeset() |
|
558 | 556 | if changesets is None: |
@@ -561,7 +559,6 b' class FilesController(BaseRepoController' | |||
|
561 | 559 | except (NodeDoesNotExistError, ChangesetError): |
|
562 | 560 | #this node is not present at tip ! |
|
563 | 561 | changesets = cs.get_file_history(f_path) |
|
564 | print time.time()-s | |
|
565 | 562 | hist_l = [] |
|
566 | 563 | |
|
567 | 564 | changesets_group = ([], _("Changesets")) |
@@ -571,9 +568,8 b' class FilesController(BaseRepoController' | |||
|
571 | 568 | for chs in changesets: |
|
572 | 569 | #_branch = '(%s)' % chs.branch if _hg else '' |
|
573 | 570 | _branch = chs.branch |
|
574 | n_desc = 'r%s:%s %s' % (chs.revision, chs.short_id, _branch) | |
|
571 | n_desc = 'r%s:%s (%s)' % (chs.revision, chs.short_id, _branch) | |
|
575 | 572 | changesets_group[0].append((chs.raw_id, n_desc,)) |
|
576 | print time.time()-s | |
|
577 | 573 | hist_l.append(changesets_group) |
|
578 | 574 | |
|
579 | 575 | for name, chs in c.rhodecode_repo.branches.items(): |
@@ -583,7 +579,7 b' class FilesController(BaseRepoController' | |||
|
583 | 579 | for name, chs in c.rhodecode_repo.tags.items(): |
|
584 | 580 | tags_group[0].append((chs, name),) |
|
585 | 581 | hist_l.append(tags_group) |
|
586 | print time.time()-s | |
|
582 | ||
|
587 | 583 | return hist_l, changesets |
|
588 | 584 | |
|
589 | 585 | @LoginRequired() |
@@ -73,6 +73,22 b' class TestFilesController(TestController' | |||
|
73 | 73 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
74 | 74 | f_path='vcs/nodes.py')) |
|
75 | 75 | |
|
76 | response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https://myissueserver.com/vcs_test_hg/issue/16">#16</a>. filecontent/commit message/author/node name are safe_unicode now. | |
|
77 | In addition some other __str__ are unicode as well | |
|
78 | Added test for unicode | |
|
79 | Improved test to clone into uniq repository. | |
|
80 | removed extra unicode conversion in diff.</div> | |
|
81 | """) | |
|
82 | ||
|
83 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") | |
|
84 | ||
|
85 | def test_file_source_history(self): | |
|
86 | self.log_user() | |
|
87 | response = self.app.get(url(controller='files', action='history', | |
|
88 | repo_name=HG_REPO, | |
|
89 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
|
90 | f_path='vcs/nodes.py'), | |
|
91 | extra_environ={'HTTP_X_PARTIAL_XHR': '1'},) | |
|
76 | 92 | #test or history |
|
77 | 93 | response.mustcontain("""<optgroup label="Changesets"> |
|
78 | 94 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> |
@@ -123,15 +139,6 b' class TestFilesController(TestController' | |||
|
123 | 139 | </optgroup> |
|
124 | 140 | """) |
|
125 | 141 | |
|
126 | response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https://myissueserver.com/vcs_test_hg/issue/16">#16</a>. filecontent/commit message/author/node name are safe_unicode now. | |
|
127 | In addition some other __str__ are unicode as well | |
|
128 | Added test for unicode | |
|
129 | Improved test to clone into uniq repository. | |
|
130 | removed extra unicode conversion in diff.</div> | |
|
131 | """) | |
|
132 | ||
|
133 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") | |
|
134 | ||
|
135 | 142 | def test_file_annotation(self): |
|
136 | 143 | self.log_user() |
|
137 | 144 | response = self.app.get(url(controller='files', action='index', |
@@ -140,6 +147,16 b' removed extra unicode conversion in diff' | |||
|
140 | 147 | f_path='vcs/nodes.py', |
|
141 | 148 | annotate=True)) |
|
142 | 149 | |
|
150 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") | |
|
151 | ||
|
152 | def test_file_annotation_history(self): | |
|
153 | self.log_user() | |
|
154 | response = self.app.get(url(controller='files', action='history', | |
|
155 | repo_name=HG_REPO, | |
|
156 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
|
157 | f_path='vcs/nodes.py', | |
|
158 | annotate=True), | |
|
159 | extra_environ={'HTTP_X_PARTIAL_XHR': '1'}) | |
|
143 | 160 | |
|
144 | 161 | response.mustcontain("""<optgroup label="Changesets"> |
|
145 | 162 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> |
@@ -189,8 +206,6 b' removed extra unicode conversion in diff' | |||
|
189 | 206 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
|
190 | 207 | </optgroup>""") |
|
191 | 208 | |
|
192 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") | |
|
193 | ||
|
194 | 209 | def test_file_annotation_git(self): |
|
195 | 210 | self.log_user() |
|
196 | 211 | response = self.app.get(url(controller='files', action='index', |
General Comments 0
You need to be logged in to leave comments.
Login now