shelve: let cmdutil.revert() take care of backing up untracked files
cmdutil.revert() backs up untracked files, so I don't see a reason to
do it shelve.mergefiles(). We have tests for this and they still pass.
Differential Revision: https://phab.mercurial-scm.org/D6174
--- a/hgext/shelve.py Fri Mar 29 11:31:42 2019 -0700
+++ b/hgext/shelve.py Fri Mar 29 11:32:02 2019 -0700
@@ -674,18 +674,8 @@
dirstate."""
with ui.configoverride({('ui', 'quiet'): True}):
hg.update(repo, wctx.node())
- files = []
- files.extend(shelvectx.files())
- files.extend(shelvectx.p1().files())
-
- # revert will overwrite unknown files, so move them out of the way
- for file in repo.status(unknown=True).unknown:
- if file in files:
- util.rename(repo.wjoin(file),
- scmutil.backuppath(ui, repo, file))
ui.pushbuffer(True)
- cmdutil.revert(ui, repo, shelvectx, repo.dirstate.parents(),
- **{r'no_backup': True})
+ cmdutil.revert(ui, repo, shelvectx, repo.dirstate.parents())
ui.popbuffer()
def restorebranch(ui, repo, branchtorestore):