Patchwork D6174: shelve: let cmdutil.revert() take care of backing up untracked files

login
register
mail settings
Submitter phabricator
Date March 30, 2019, 1:49 a.m.
Message ID <0cb549bb1ad4f4edca1d5e81ea5f78a3@localhost.localdomain>
Download mbox | patch
Permalink /patch/39416/
State Not Applicable
Headers show

Comments

phabricator - March 30, 2019, 1:49 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe08559769bc6: shelve: let cmdutil.revert() take care of backing up untracked files (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6174?vs=14605&id=14608

REVISION DETAIL
  https://phab.mercurial-scm.org/D6174

AFFECTED FILES
  hgext/shelve.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -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):