Mercurial > hg
changeset 42038:e08559769bc6
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 29 Mar 2019 11:32:02 -0700 |
parents | 4606585549b1 |
children | cab19d49f8bd |
files | hgext/shelve.py |
diffstat | 1 files changed, 1 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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):