Show More
@@ -66,36 +66,6 b' class ChangesetController(BaseController' | |||||
66 | </tr> |
|
66 | </tr> | |
67 | </table>''' % str |
|
67 | </table>''' % str | |
68 |
|
68 | |||
69 | def get_cs_range(repo, rev_start, rev_end, limit=None): |
|
|||
70 | """ |
|
|||
71 | Temp fix function until VCS will handle that |
|
|||
72 | see issue #48 |
|
|||
73 | :param rev_start: |
|
|||
74 | :param rev_end: |
|
|||
75 | """ |
|
|||
76 |
|
||||
77 | start_cs = repo.get_changeset(rev_start) |
|
|||
78 | end_cs = repo.get_changeset(rev_end) |
|
|||
79 |
|
||||
80 | if start_cs.revision >= end_cs.revision: |
|
|||
81 | raise Exception('Start revision cannot be after End') |
|
|||
82 |
|
||||
83 | yield start_cs |
|
|||
84 |
|
||||
85 | cnt = 0 |
|
|||
86 | while 1: |
|
|||
87 |
|
||||
88 | next = start_cs.next() |
|
|||
89 | yield next |
|
|||
90 | start_cs = next |
|
|||
91 | cnt += 1 |
|
|||
92 | if next == end_cs: |
|
|||
93 | break |
|
|||
94 | if limit and cnt > limit: |
|
|||
95 | break |
|
|||
96 | #====================================================================== |
|
|||
97 | # REAL CODE BELOW |
|
|||
98 | #====================================================================== |
|
|||
99 | #get ranges of revisions if preset |
|
69 | #get ranges of revisions if preset | |
100 | rev_range = revision.split('...')[:2] |
|
70 | rev_range = revision.split('...')[:2] | |
101 | range_limit = 50 |
|
71 | range_limit = 50 | |
@@ -104,7 +74,8 b' class ChangesetController(BaseController' | |||||
104 | if len(rev_range) == 2: |
|
74 | if len(rev_range) == 2: | |
105 | rev_start = rev_range[0] |
|
75 | rev_start = rev_range[0] | |
106 | rev_end = rev_range[1] |
|
76 | rev_end = rev_range[1] | |
107 |
rev_ranges = get_cs_range( |
|
77 | rev_ranges = repo.get_changeset_ranges(rev_start, rev_end, | |
|
78 | range_limit) | |||
108 | else: |
|
79 | else: | |
109 | rev_ranges = [repo.get_changeset(revision)] |
|
80 | rev_ranges = [repo.get_changeset(revision)] | |
110 |
|
81 |
General Comments 0
You need to be logged in to leave comments.
Login now