destutil: consistently retrieve 'p1' and 'branch'
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 08 Feb 2016 14:56:28 +0100
changeset 28104 96f8baddbd6a
parent 28103 7d852bb47b0a
child 28105 1fc7b5363871
destutil: consistently retrieve 'p1' and 'branch' We already read p1 from the dirstate so let's read the branch from it too.
mercurial/destutil.py
--- a/mercurial/destutil.py	Mon Feb 08 14:55:58 2016 +0100
+++ b/mercurial/destutil.py	Mon Feb 08 14:56:28 2016 +0100
@@ -194,7 +194,7 @@
     """find merge destination based on branch heads"""
     node = None
     parent = repo.dirstate.p1()
-    branch = repo[None].branch()
+    branch = repo.dirstate.branch()
     bheads = repo.branchheads(branch)
     nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]