# HG changeset patch # User Matt Mackall # Date 1327867665 21600 # Node ID eb85d5f89fefee0e989f2a975a5aee30c502d298 # Parent ed9f40bc346fefcfef37e7186ac78f5895fbaf5a 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 diff -r ed9f40bc346f -r eb85d5f89fef mercurial/commands.py --- 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: