Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 23325:4165cfd67519
remove: recurse into subrepositories with --subrepos/-S flag
Like 'forget', git and svn subrepos are currently not supported. Unfortunately
the name 'remove' is already used in the subrepo classes, so we break the
convention of naming the subrepo function after the command.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 15 Nov 2014 21:36:19 -0500 |
parents | 7d754b7acd55 |
children | 55525924af43 |
line wrap: on
line diff
--- a/mercurial/subrepo.py Sat Nov 15 13:50:43 2014 +0900 +++ b/mercurial/subrepo.py Sat Nov 15 21:36:19 2014 -0500 @@ -501,6 +501,13 @@ def forget(self, ui, match, prefix): return ([], []) + def removefiles(self, ui, matcher, prefix, after, force, subrepos): + """remove the matched files from the subrepository and the filesystem, + possibly by force and/or after the file has been removed from the + filesystem. Return 0 on success, 1 on any warning. + """ + return 1 + def revert(self, ui, substate, *pats, **opts): ui.warn('%s: reverting %s subrepos is unsupported\n' \ % (substate[0], substate[2])) @@ -854,6 +861,12 @@ os.path.join(prefix, self._path), True) @annotatesubrepoerror + def removefiles(self, ui, matcher, prefix, after, force, subrepos): + return cmdutil.remove(ui, self._repo, matcher, + os.path.join(prefix, self._path), after, force, + subrepos) + + @annotatesubrepoerror def revert(self, ui, substate, *pats, **opts): # reverting a subrepo is a 2 step process: # 1. if the no_backup is not set, revert all modified