changeset 3726:630c98f52416 beta

pullrequests: better handling of cases with more than one ancestor
author Mads Kiilerich <madski@unity3d.com>
date Fri, 05 Apr 2013 00:40:58 +0200
parents f73a63831d3f
children 0cecc22285ef
files rhodecode/model/pull_request.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/pull_request.py	Fri Apr 05 00:40:58 2013 +0200
+++ b/rhodecode/model/pull_request.py	Fri Apr 05 00:40:58 2013 +0200
@@ -211,7 +211,8 @@
 
                 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