Show More
@@ -551,8 +551,6 b' class FilesController(BaseRepoController' | |||||
551 | :param changesets: if passed don't calculate history and take |
|
551 | :param changesets: if passed don't calculate history and take | |
552 | changesets defined in this list |
|
552 | changesets defined in this list | |
553 | """ |
|
553 | """ | |
554 | import time |
|
|||
555 | s = time.time() |
|
|||
556 | # calculate history based on tip |
|
554 | # calculate history based on tip | |
557 | tip_cs = c.rhodecode_repo.get_changeset() |
|
555 | tip_cs = c.rhodecode_repo.get_changeset() | |
558 | if changesets is None: |
|
556 | if changesets is None: | |
@@ -561,7 +559,6 b' class FilesController(BaseRepoController' | |||||
561 | except (NodeDoesNotExistError, ChangesetError): |
|
559 | except (NodeDoesNotExistError, ChangesetError): | |
562 | #this node is not present at tip ! |
|
560 | #this node is not present at tip ! | |
563 | changesets = cs.get_file_history(f_path) |
|
561 | changesets = cs.get_file_history(f_path) | |
564 | print time.time()-s |
|
|||
565 | hist_l = [] |
|
562 | hist_l = [] | |
566 |
|
563 | |||
567 | changesets_group = ([], _("Changesets")) |
|
564 | changesets_group = ([], _("Changesets")) | |
@@ -571,9 +568,8 b' class FilesController(BaseRepoController' | |||||
571 | for chs in changesets: |
|
568 | for chs in changesets: | |
572 | #_branch = '(%s)' % chs.branch if _hg else '' |
|
569 | #_branch = '(%s)' % chs.branch if _hg else '' | |
573 | _branch = chs.branch |
|
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 | changesets_group[0].append((chs.raw_id, n_desc,)) |
|
572 | changesets_group[0].append((chs.raw_id, n_desc,)) | |
576 | print time.time()-s |
|
|||
577 | hist_l.append(changesets_group) |
|
573 | hist_l.append(changesets_group) | |
578 |
|
574 | |||
579 | for name, chs in c.rhodecode_repo.branches.items(): |
|
575 | for name, chs in c.rhodecode_repo.branches.items(): | |
@@ -583,7 +579,7 b' class FilesController(BaseRepoController' | |||||
583 | for name, chs in c.rhodecode_repo.tags.items(): |
|
579 | for name, chs in c.rhodecode_repo.tags.items(): | |
584 | tags_group[0].append((chs, name),) |
|
580 | tags_group[0].append((chs, name),) | |
585 | hist_l.append(tags_group) |
|
581 | hist_l.append(tags_group) | |
586 | print time.time()-s |
|
582 | ||
587 | return hist_l, changesets |
|
583 | return hist_l, changesets | |
588 |
|
584 | |||
589 | @LoginRequired() |
|
585 | @LoginRequired() |
@@ -73,6 +73,22 b' class TestFilesController(TestController' | |||||
73 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
73 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
74 | f_path='vcs/nodes.py')) |
|
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 | #test or history |
|
92 | #test or history | |
77 | response.mustcontain("""<optgroup label="Changesets"> |
|
93 | response.mustcontain("""<optgroup label="Changesets"> | |
78 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> |
|
94 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> | |
@@ -123,15 +139,6 b' class TestFilesController(TestController' | |||||
123 | </optgroup> |
|
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 | def test_file_annotation(self): |
|
142 | def test_file_annotation(self): | |
136 | self.log_user() |
|
143 | self.log_user() | |
137 | response = self.app.get(url(controller='files', action='index', |
|
144 | response = self.app.get(url(controller='files', action='index', | |
@@ -140,6 +147,16 b' removed extra unicode conversion in diff' | |||||
140 | f_path='vcs/nodes.py', |
|
147 | f_path='vcs/nodes.py', | |
141 | annotate=True)) |
|
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 | response.mustcontain("""<optgroup label="Changesets"> |
|
161 | response.mustcontain("""<optgroup label="Changesets"> | |
145 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> |
|
162 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> | |
@@ -189,8 +206,6 b' removed extra unicode conversion in diff' | |||||
189 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
|
206 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> | |
190 | </optgroup>""") |
|
207 | </optgroup>""") | |
191 |
|
208 | |||
192 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") |
|
|||
193 |
|
||||
194 | def test_file_annotation_git(self): |
|
209 | def test_file_annotation_git(self): | |
195 | self.log_user() |
|
210 | self.log_user() | |
196 | response = self.app.get(url(controller='files', action='index', |
|
211 | response = self.app.get(url(controller='files', action='index', |
General Comments 0
You need to be logged in to leave comments.
Login now