1. Bill_Barry
  2. hgattic

Commits

Greg Ward  committed 668531f

After revert, remove added files.

This means unshelve will be able to re-add the files. Without this
change, the user has to remember to remove the new files before
unshelving, or unshelve fails with conflicts.

  • Participants
  • Parent commits 63e4a56
  • Branches default

Comments (0)

Files changed (1)

File attic.py

View file
  • Ignore whitespace
         '''removes all changes from the working copy and makes it so
         there isn't a patch applied'''
 
+        # find added files in the user's chosen set
+        m = cmdutil.match(repo, pats, opts)
+        added = repo.status(match=m)[1]
+
         revertopts = { 'include': opts['include'],
                        'exclude': opts['exclude'],
                        'date': None,
                        'no_backup': True,
                      }
         commands.revert(self.ui, repo, *pats, **revertopts)
+
+        # finish the job of reverting added files (safe because they are
+        # saved in the attic patch)
+        for fn in added:
+            self.ui.status(_('removing %s\n') % fn)
+            util.unlink(fn)
+
         self.applied = ''
         self.persiststate()