Mercurial > public > mercurial-scm > hg-stable
diff hgext/fetch.py @ 7854:423b4482c5cb
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.
author | Benjamin Pollack <benjamin@bitquabit.com> |
---|---|
date | Tue, 17 Mar 2009 11:47:40 -0400 |
parents | 26adfaccdf73 |
children | 7b813bdbd5d0 |
line wrap: on
line diff
--- 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: