Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 28607:a88959ae5938
remove: queue warnings until after status messages (issue5140) (API)
Before this change, warnings were interspersed with (and easily drowned out by)
status messages.
API:
abstractsubrepo.removefiles has an extra argument warnings,
into which callees should append their warnings.
Note: Callees should not assume that there will be items in the list,
today, I'm lazily including any other subrepos warnings, but
that may change.
cmdutil.remove has an extra optional argument warnings,
into which it will place warnings.
If warnings is omitted, warnings will be reported via ui.warn()
as before this change (albeit, after any status messages).
author | timeless <timeless@mozdev.org> |
---|---|
date | Thu, 17 Mar 2016 18:19:36 +0000 |
parents | d3f1b7ee5e70 |
children | 345f4fa4cc89 |
line wrap: on
line diff
--- a/mercurial/subrepo.py Mon Mar 21 04:01:29 2016 +0000 +++ b/mercurial/subrepo.py Thu Mar 17 18:19:36 2016 +0000 @@ -575,11 +575,13 @@ def forget(self, match, prefix): return ([], []) - def removefiles(self, matcher, prefix, after, force, subrepos): + def removefiles(self, matcher, prefix, after, force, subrepos, warnings): """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. """ + warnings.append(_("warning: removefiles not implemented (%s)") + % self._path) return 1 def revert(self, substate, *pats, **opts): @@ -991,7 +993,7 @@ self.wvfs.reljoin(prefix, self._path), True) @annotatesubrepoerror - def removefiles(self, matcher, prefix, after, force, subrepos): + def removefiles(self, matcher, prefix, after, force, subrepos, warnings): return cmdutil.remove(self.ui, self._repo, matcher, self.wvfs.reljoin(prefix, self._path), after, force, subrepos)