mercurial/cmdutil.py
changeset 44271 c791ed6a2154
parent 44194 d4c1501225c4
child 44295 142d2a4cb69a
--- 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: