Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 44318:c791ed6a2154
merge: introduce a revert_to() for that use-case
In the same vein as the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D7901
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 15 Jan 2020 14:47:38 -0800 |
parents | d4c1501225c4 |
children | 142d2a4cb69a |
line wrap: on
line diff
--- 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: