diff -r f546d2170b0f -r c791ed6a2154 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Jan 15 15:30:25 2020 -0800 +++ b/mercurial/cmdutil.py Wed Jan 15 14:47:38 2020 -0800 @@ -584,15 +584,8 @@ [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles] # 3a. apply filtered patch to clean repo (clean) if backups: - # Equivalent to hg.revert m = scmutil.matchfiles(repo, set(backups.keys()) | alsorestore) - mergemod.update( - repo, - repo.dirstate.p1(), - branchmerge=False, - force=True, - matcher=m, - ) + mergemod.revert_to(repo[b'.'], matcher=m) # 3b. (apply) if dopatch: