diff mercurial/destutil.py @ 29284:1c7167009936

update: fix bare --clean to work on new branch (issue5003) (BC) Before this commit bare update --clean on newly created branch updates to the parent commit, even if there are later commits on the parent commit's branch. Update to the latest head on the parent commit's branch instead. This seems reasonable as clean should discard uncommited changes, branch is one of them.
author liscju <piotr.listkiewicz@gmail.com>
date Tue, 05 Apr 2016 07:30:01 +0200
parents cf7de4aeb86b
children 40f845537dca
line wrap: on
line diff
--- a/mercurial/destutil.py	Fri Jun 03 15:55:07 2016 +0200
+++ b/mercurial/destutil.py	Tue Apr 05 07:30:01 2016 +0200
@@ -95,6 +95,10 @@
     wc = repo[None]
     movemark = node = None
     currentbranch = wc.branch()
+
+    if clean:
+        currentbranch = repo['.'].branch()
+
     if currentbranch in repo.branchmap():
         heads = repo.branchheads(currentbranch)
         if heads: