fetch: patch cornercase in children calculation (issue2773) stable
authorMatt Mackall <mpm@selenic.com>
Fri, 30 Dec 2011 14:31:59 -0600
branchstable
changeset 15748 6eb5bbaa1e73
parent 15746 4bf553038b82
child 15749 6b84cdcb05b9
fetch: patch cornercase in children calculation (issue2773)
hgext/fetch.py
--- a/hgext/fetch.py	Thu Dec 29 14:44:30 2011 -0600
+++ b/hgext/fetch.py	Fri Dec 30 14:31:59 2011 -0600
@@ -83,7 +83,7 @@
         # Is this a simple fast-forward along the current branch?
         newheads = repo.branchheads(branch)
         newchildren = repo.changelog.nodesbetween([parent], newheads)[2]
-        if len(newheads) == 1:
+        if len(newheads) == 1 and len(newchildren):
             if newchildren[0] != parent:
                 return hg.clean(repo, newchildren[0])
             else: