Mercurial > kallithea
comparison rhodecode/model/pull_request.py @ 3723:3761a66b8add beta
pullrequests: handle the case where no matching revisions are found for either end
Use -1 as default revision - that is the null revision.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 05 Apr 2013 00:40:58 +0200 |
parents | 5dcfa6304f88 |
children | a327492d84df |
comparison
equal
deleted
inserted
replaced
3722:5dcfa6304f88 | 3723:3761a66b8add |
---|---|
183 'rev': 'id', | 183 'rev': 'id', |
184 } | 184 } |
185 | 185 |
186 org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]], | 186 org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]], |
187 safe_str(org_ref[1])) | 187 safe_str(org_ref[1])) |
188 org_rev = org_repo._repo[scmutil.revrange(org_repo._repo, | 188 org_revs = scmutil.revrange(org_repo._repo, [org_rev_spec]) |
189 [org_rev_spec])[-1]] | 189 org_rev = org_repo._repo[org_revs[-1] if org_revs else -1] |
190 | 190 |
191 other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]], | 191 other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]], |
192 safe_str(other_ref[1])) | 192 safe_str(other_ref[1])) |
193 other_rev = other_repo._repo[scmutil.revrange(other_repo._repo, | 193 other_revs = scmutil.revrange(other_repo._repo, [other_rev_spec]) |
194 [other_rev_spec])[-1]] | 194 other_rev = other_repo._repo[other_revs[-1] if other_revs else -1] |
195 | 195 |
196 #case two independent repos | 196 #case two independent repos |
197 if org_repo != other_repo: | 197 if org_repo != other_repo: |
198 hgrepo = unionrepo.unionrepository(other_repo.baseui, | 198 hgrepo = unionrepo.unionrepository(other_repo.baseui, |
199 other_repo.path, | 199 other_repo.path, |