bookmarks: move current bookmark on update -u and bare pull -u (
issue3222)
Currently, this won't update when a #branch spec is in the URL
--- a/mercurial/commands.py Sun Jan 29 13:36:10 2012 -0600
+++ b/mercurial/commands.py Sun Jan 29 14:07:45 2012 -0600
@@ -4260,11 +4260,16 @@
if modheads == 0:
return
if optupdate:
+ movemarkfrom = repo['.'].node()
try:
- return hg.update(repo, checkout)
+ ret = hg.update(repo, checkout)
except util.Abort, inst:
ui.warn(_("not updating: %s\n" % str(inst)))
return 0
+ if not ret and not checkout:
+ if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
+ ui.status(_("updating bookmark %s\n") % repo._bookmarkcurrent)
+ return ret
if modheads > 1:
currentbranchheads = len(repo.branchheads())
if currentbranchheads == modheads: