diff -r 48a1a974a92c -r f546d2170b0f mercurial/merge.py --- a/mercurial/merge.py Wed Feb 05 16:16:15 2020 -0500 +++ b/mercurial/merge.py Wed Jan 15 15:30:25 2020 -0800 @@ -2597,6 +2597,15 @@ return stats +def clean_update(ctx, wc=None): + """Do a clean update to the given commit. + + This involves updating to the commit and discarding any changes in the + working copy. + """ + return update(ctx.repo(), ctx.rev(), branchmerge=False, force=True, wc=wc) + + def graft( repo, ctx,