# HG changeset patch # User Mads Kiilerich # Date 2013-04-04 22:40:58 # Node ID 630c98f52416a6c5333c4912b33a80b6cb127c6c # Parent f73a63831d3f16078c5e4077a8d6be2a953e27a6 pullrequests: better handling of cases with more than one ancestor 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 @@ -211,7 +211,8 @@ class PullRequestModel(BaseModel): ancestors = scmutil.revrange(hgrepo, ["ancestor(id('%s'), id('%s'))" % (org_rev, other_rev)]) - if len(ancestors) == 1: + if ancestors: + # pick arbitrary ancestor - but there is usually only one ancestor = hgrepo[ancestors[0]].hex() else: # TODO: have both + and - changesets