diff -r 14eee72c8d52 -r 1c7167009936 mercurial/destutil.py --- 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: