Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 15912:2bd54ffaa27e
forget: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the forget
command (95174c381525), subrepo recursion wasn't taken into account. This
change fixes that by pulling the majority of the logic of commands.forget into
cmdutil.forget, which can then be called from both there and subrepo.forget.
author | David M. Carr <david@carrclan.us> |
---|---|
date | Tue, 17 Jan 2012 19:10:59 -0500 |
parents | 933b9ff73750 |
children | 0776a6cababe 131d1a09108a |
line wrap: on
line diff
--- a/mercurial/context.py Tue Jan 17 19:10:58 2012 -0500 +++ b/mercurial/context.py Tue Jan 17 19:10:59 2012 -0500 @@ -900,16 +900,20 @@ finally: wlock.release() - def forget(self, files): + def forget(self, files, prefix=""): + join = lambda f: os.path.join(prefix, f) wlock = self._repo.wlock() try: + rejected = [] for f in files: if self._repo.dirstate[f] != 'a': self._repo.dirstate.remove(f) elif f not in self._repo.dirstate: - self._repo.ui.warn(_("%s not tracked!\n") % f) + self._repo.ui.warn(_("%s not tracked!\n") % join(f)) + rejected.append(f) else: self._repo.dirstate.drop(f) + return rejected finally: wlock.release()