# HG changeset patch # User Mads Kiilerich # Date 2013-04-04 22:40:58 # Node ID 3761a66b8addacd392cbeed7957b780cc67fd317 # Parent 5dcfa6304f888c737c76906e66ab195036934f63 pullrequests: handle the case where no matching revisions are found for either end Use -1 as default revision - that is the null revision. diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -185,13 +185,13 @@ class PullRequestModel(BaseModel): org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]], safe_str(org_ref[1])) - org_rev = org_repo._repo[scmutil.revrange(org_repo._repo, - [org_rev_spec])[-1]] + org_revs = scmutil.revrange(org_repo._repo, [org_rev_spec]) + org_rev = org_repo._repo[org_revs[-1] if org_revs else -1] other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]], safe_str(other_ref[1])) - other_rev = other_repo._repo[scmutil.revrange(other_repo._repo, - [other_rev_spec])[-1]] + other_revs = scmutil.revrange(other_repo._repo, [other_rev_spec]) + other_rev = other_repo._repo[other_revs[-1] if other_revs else -1] #case two independent repos if org_repo != other_repo: