mercurial/cmdutil.py
changeset 44271 c791ed6a2154
parent 44194 d4c1501225c4
child 44295 142d2a4cb69a
equal deleted inserted replaced
44270:f546d2170b0f 44271:c791ed6a2154
   582                 fp.seek(0)
   582                 fp.seek(0)
   583 
   583 
   584             [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles]
   584             [os.unlink(repo.wjoin(c)) for c in newlyaddedandmodifiedfiles]
   585             # 3a. apply filtered patch to clean repo  (clean)
   585             # 3a. apply filtered patch to clean repo  (clean)
   586             if backups:
   586             if backups:
   587                 # Equivalent to hg.revert
       
   588                 m = scmutil.matchfiles(repo, set(backups.keys()) | alsorestore)
   587                 m = scmutil.matchfiles(repo, set(backups.keys()) | alsorestore)
   589                 mergemod.update(
   588                 mergemod.revert_to(repo[b'.'], matcher=m)
   590                     repo,
       
   591                     repo.dirstate.p1(),
       
   592                     branchmerge=False,
       
   593                     force=True,
       
   594                     matcher=m,
       
   595                 )
       
   596 
   589 
   597             # 3b. (apply)
   590             # 3b. (apply)
   598             if dopatch:
   591             if dopatch:
   599                 try:
   592                 try:
   600                     ui.debug(b'applying patch\n')
   593                     ui.debug(b'applying patch\n')