# HG changeset patch # User Benjamin Pollack # Date 1237304860 14400 # Node ID 423b4482c5cb08670514a32456c39d09254a2d6f # Parent af062a9fea9bf98593f6aa81c06dcd1da24cd3a0 fetch: do not count inactive branches when inferring a merge The fetch extension would erroneously consider inactive branches when inferring which branches to merge. It now considers only active branches. diff -r af062a9fea9b -r 423b4482c5cb hgext/fetch.py --- a/hgext/fetch.py Tue Mar 17 13:43:11 2009 -0500 +++ b/hgext/fetch.py Tue Mar 17 11:47:40 2009 -0400 @@ -52,7 +52,9 @@ raise util.Abort(_('outstanding uncommitted changes')) if del_: raise util.Abort(_('working directory is missing some files')) - if len(repo.branchheads(branch)) > 1: + bheads = repo.branchheads(branch) + bheads = [head for head in bheads if len(repo[head].children()) == 0] + if len(bheads) > 1: raise util.Abort(_('multiple heads in this branch ' '(use "hg heads ." and "hg merge" to merge)')) @@ -76,6 +78,7 @@ # Is this a simple fast-forward along the current branch? newheads = repo.branchheads(branch) + newheads = [head for head in newheads if len(repo[head].children()) == 0] newchildren = repo.changelog.nodesbetween([parent], newheads)[2] if len(newheads) == 1: if newchildren[0] != parent: