Show More
@@ -66,7 +66,7 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): |
|
69 | def get_cs_range(repo, rev_start, rev_end, limit=None): | |
70 | """ |
|
70 | """ | |
71 | Temp fix function until VCS will handle that |
|
71 | Temp fix function until VCS will handle that | |
72 | see issue #48 |
|
72 | see issue #48 | |
@@ -82,25 +82,29 b' class ChangesetController(BaseController' | |||||
82 |
|
82 | |||
83 | yield start_cs |
|
83 | yield start_cs | |
84 |
|
84 | |||
|
85 | cnt = 0 | |||
85 | while 1: |
|
86 | while 1: | |
|
87 | ||||
86 | next = start_cs.next() |
|
88 | next = start_cs.next() | |
87 | yield next |
|
89 | yield next | |
88 | start_cs = next |
|
90 | start_cs = next | |
|
91 | cnt += 1 | |||
89 | if next == end_cs: |
|
92 | if next == end_cs: | |
90 | break |
|
93 | break | |
91 |
|
94 | if limit and cnt > limit: | ||
|
95 | break | |||
92 | #====================================================================== |
|
96 | #====================================================================== | |
93 | # REAL CODE BELOW |
|
97 | # REAL CODE BELOW | |
94 | #====================================================================== |
|
98 | #====================================================================== | |
95 | #get ranges of revisions if preset |
|
99 | #get ranges of revisions if preset | |
96 | rev_range = revision.split('...')[:2] |
|
100 | rev_range = revision.split('...')[:2] | |
97 |
|
101 | range_limit = 50 | ||
98 | try: |
|
102 | try: | |
99 | repo = hg_model.get_repo(c.repo_name) |
|
103 | repo = hg_model.get_repo(c.repo_name) | |
100 | if len(rev_range) == 2: |
|
104 | if len(rev_range) == 2: | |
101 | rev_start = rev_range[0] |
|
105 | rev_start = rev_range[0] | |
102 | rev_end = rev_range[1] |
|
106 | rev_end = rev_range[1] | |
103 | rev_ranges = get_cs_range(repo, rev_start, rev_end) |
|
107 | rev_ranges = get_cs_range(repo, rev_start, rev_end, range_limit) | |
104 | else: |
|
108 | else: | |
105 | rev_ranges = [repo.get_changeset(revision)] |
|
109 | rev_ranges = [repo.get_changeset(revision)] | |
106 |
|
110 |
@@ -5,7 +5,7 b'' | |||||
5 |
|
5 | |||
6 | Simple smtp mailer used in RhodeCode |
|
6 | Simple smtp mailer used in RhodeCode | |
7 |
|
7 | |||
8 |
:created_on: Sep 13, 201 |
|
8 | :created_on: Sep 13, 2010 | |
9 | :copyright: (c) 2011 by marcink. |
|
9 | :copyright: (c) 2011 by marcink. | |
10 | :license: LICENSE_NAME, see LICENSE_FILE for more details. |
|
10 | :license: LICENSE_NAME, see LICENSE_FILE for more details. | |
11 | """ |
|
11 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now