diff mercurial/commands.py @ 28274:5d9578d9ad1a

pull: deactivate a bookmark not matching with the destination of the update Before this patch, "hg pull -u" with a target doesn't deactivate a current active bookmark, which doesn't match with the explicit destination of the update, even though bare "hg update" does so. A "target" can be provided through: - option --rev ANOTHER - option --branch ANOTHER - source URL#ANOTHER
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 26 Feb 2016 20:22:05 +0900
parents 9ac8955d8c45
children aa73d6a5d9ea
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Feb 26 20:22:05 2016 +0900
+++ b/mercurial/commands.py	Fri Feb 26 20:22:05 2016 +0900
@@ -5570,6 +5570,11 @@
             if brev != repo._activebookmark:
                 ui.status(_("(activating bookmark %s)\n") % brev)
             bookmarks.activate(repo, brev)
+        elif brev:
+            if repo._activebookmark:
+                ui.status(_("(leaving bookmark %s)\n") %
+                          repo._activebookmark)
+            bookmarks.deactivate(repo)
         return ret
     if modheads > 1:
         currentbranchheads = len(repo.branchheads())