diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -196,9 +196,6 @@ def push(oldpush, ui, repo, dest=None, * return result def uisetup(ui): - if ui.configbool('bookmarks', 'track.current'): - extensions.wrapcommand(commands.table, 'update', updatecurbookmark) - entry = extensions.wrapcommand(commands.table, 'pull', pull) entry[1].append(('B', 'bookmark', [], _("bookmark to import"), @@ -208,19 +205,6 @@ def uisetup(ui): _("bookmark to export"), _('BOOKMARK'))) -def updatecurbookmark(orig, ui, repo, *args, **opts): - '''Set the current bookmark - - If the user updates to a bookmark we update the .hg/bookmarks.current - file. - ''' - res = orig(ui, repo, *args, **opts) - rev = opts['rev'] - if not rev and len(args) > 0: - rev = args[0] - bookmarks.setcurrent(repo, rev) - return res - cmdtable = { "bookmarks": (bookmark, diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3893,9 +3893,14 @@ def update(ui, repo, node=None, rev=None rev = cmdutil.finddate(ui, repo, date) if clean or check: - return hg.clean(repo, rev) + ret = hg.clean(repo, rev) else: - return hg.update(repo, rev) + ret = hg.update(repo, rev) + + if repo.ui.configbool('bookmarks', 'track.current'): + bookmarks.setcurrent(repo, rev) + + return ret def verify(ui, repo): """verify the integrity of the repository