# HG changeset patch # User Martin von Zweigbergk # Date 2017-02-13 19:58:02 # Node ID 7beb3ec344433134cf85deac65f557b124bbe900 # Parent 11c253997b0e793751c24232fcc30fbd74798e0a update: move check for dirty wdir into hg.updatetotally() The function has a "check" parameter that's currently unused, and it makes sense to me to have it honor it. That way other callers than commands.update() could set it if they needed. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5363,9 +5363,6 @@ def update(ui, repo, node=None, rev=None brev = rev rev = scmutil.revsingle(repo, rev, rev).rev() - if check: - cmdutil.bailifchanged(repo, merge=False) - repo.ui.setconfig('ui', 'forcemerge', tool, 'update') return hg.updatetotally(ui, repo, rev, brev, clean=clean, check=check) diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -739,6 +739,8 @@ def updatetotally(ui, repo, checkout, br if clean: ret = _clean(repo, checkout) else: + if check: + cmdutil.bailifchanged(repo, merge=False) ret = _update(repo, checkout) if not ret and movemarkfrom: