diff -r 7a97a622244d -r ea63a2004d09 mercurial/commands.py --- a/mercurial/commands.py Fri Apr 27 01:35:00 2018 -0400 +++ b/mercurial/commands.py Mon May 07 19:43:43 2018 -0700 @@ -5583,18 +5583,19 @@ repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') ctx = scmutil.revsingle(repo, rev, rev) rev = ctx.rev() - if ctx.hidden(): + hidden = ctx.hidden() + repo.ui.setconfig('ui', 'forcemerge', opts.get(r'tool'), 'update') + + ret = hg.updatetotally(ui, repo, rev, brev, clean=clean, + updatecheck=updatecheck) + if hidden: ctxstr = ctx.hex()[:12] - ui.warn(_("updating to a hidden changeset %s\n") % ctxstr) + ui.warn(_("updated to hidden changeset %s\n") % ctxstr) if ctx.obsolete(): obsfatemsg = obsutil._getfilteredreason(repo, ctxstr, ctx) ui.warn("(%s)\n" % obsfatemsg) - - repo.ui.setconfig('ui', 'forcemerge', opts.get(r'tool'), 'update') - - return hg.updatetotally(ui, repo, rev, brev, clean=clean, - updatecheck=updatecheck) + return ret @command('verify', []) def verify(ui, repo):