Show More
@@ -96,16 +96,10 b' class CompareController(BaseRepoControll' | |||
|
96 | 96 | redirect(h.url('summary_home', repo_name=repo.repo_name)) |
|
97 | 97 | raise HTTPBadRequest() |
|
98 | 98 | |
|
99 |
def _get_changesets(self, alias, org_repo, org_re |
|
|
99 | def _get_changesets(self, alias, org_repo, org_rev, other_repo, other_rev, merge): | |
|
100 | 100 | """ |
|
101 |
Returns a list of changesets that can be merged from org_repo@org_re |
|
|
102 |
to other_repo@other_re |
|
|
103 | ||
|
104 | :param org_repo: | |
|
105 | :param org_ref: | |
|
106 | :param other_repo: | |
|
107 | :param other_ref: | |
|
108 | :param tmp: | |
|
101 | Returns a list of changesets that can be merged from org_repo@org_rev | |
|
102 | to other_repo@other_rev ... and the ancestor that would be used for merge | |
|
109 | 103 | """ |
|
110 | 104 | |
|
111 | 105 | ancestor = None |
@@ -116,22 +110,6 b' class CompareController(BaseRepoControll' | |||
|
116 | 110 | ancestor = org_rev |
|
117 | 111 | |
|
118 | 112 | elif alias == 'hg': |
|
119 | # lookup up the exact node id | |
|
120 | _revset_predicates = { | |
|
121 | 'branch': 'branch', | |
|
122 | 'book': 'bookmark', | |
|
123 | 'tag': 'tag', | |
|
124 | 'rev': 'id', | |
|
125 | } | |
|
126 | ||
|
127 | org_rev_spec = "max(%s(%%s))" % _revset_predicates[org_ref[0]] | |
|
128 | org_revs = org_repo._repo.revs(org_rev_spec, safe_str(org_ref[1])) | |
|
129 | org_rev = org_repo._repo[org_revs[-1] if org_revs else -1].hex() | |
|
130 | ||
|
131 | other_revs_spec = "max(%s(%%s))" % _revset_predicates[other_ref[0]] | |
|
132 | other_revs = other_repo._repo.revs(other_revs_spec, safe_str(other_ref[1])) | |
|
133 | other_rev = other_repo._repo[other_revs[-1] if other_revs else -1].hex() | |
|
134 | ||
|
135 | 113 | #case two independent repos |
|
136 | 114 | if org_repo != other_repo: |
|
137 | 115 | hgrepo = unionrepo.unionrepository(other_repo.baseui, |
@@ -166,7 +144,7 b' class CompareController(BaseRepoControll' | |||
|
166 | 144 | |
|
167 | 145 | so, se = org_repo.run_git_command( |
|
168 | 146 | 'log --reverse --pretty="format: %%H" -s -p %s..%s' |
|
169 |
% (org_re |
|
|
147 | % (org_rev, other_rev) | |
|
170 | 148 | ) |
|
171 | 149 | changesets = [org_repo.get_changeset(cs) |
|
172 | 150 | for cs in re.findall(r'[0-9a-fA-F]{40}', so)] |
@@ -235,8 +213,8 b' class CompareController(BaseRepoControll' | |||
|
235 | 213 | c.other_ref_type = other_ref[0] |
|
236 | 214 | |
|
237 | 215 | c.cs_ranges, c.ancestor = self._get_changesets(org_repo.scm_instance.alias, |
|
238 |
org_repo.scm_instance, org_re |
|
|
239 |
other_repo.scm_instance, other_re |
|
|
216 | org_repo.scm_instance, org_rev, | |
|
217 | other_repo.scm_instance, other_rev, | |
|
240 | 218 | merge) |
|
241 | 219 | |
|
242 | 220 | c.statuses = c.rhodecode_db_repo.statuses([x.raw_id for x in |
General Comments 0
You need to be logged in to leave comments.
Login now