comparison 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
comparison
equal deleted inserted replaced
28606:8cc51c5a9365 28607:a88959ae5938
573 pass 573 pass
574 574
575 def forget(self, match, prefix): 575 def forget(self, match, prefix):
576 return ([], []) 576 return ([], [])
577 577
578 def removefiles(self, matcher, prefix, after, force, subrepos): 578 def removefiles(self, matcher, prefix, after, force, subrepos, warnings):
579 """remove the matched files from the subrepository and the filesystem, 579 """remove the matched files from the subrepository and the filesystem,
580 possibly by force and/or after the file has been removed from the 580 possibly by force and/or after the file has been removed from the
581 filesystem. Return 0 on success, 1 on any warning. 581 filesystem. Return 0 on success, 1 on any warning.
582 """ 582 """
583 warnings.append(_("warning: removefiles not implemented (%s)")
584 % self._path)
583 return 1 585 return 1
584 586
585 def revert(self, substate, *pats, **opts): 587 def revert(self, substate, *pats, **opts):
586 self.ui.warn('%s: reverting %s subrepos is unsupported\n' \ 588 self.ui.warn('%s: reverting %s subrepos is unsupported\n' \
587 % (substate[0], substate[2])) 589 % (substate[0], substate[2]))
989 def forget(self, match, prefix): 991 def forget(self, match, prefix):
990 return cmdutil.forget(self.ui, self._repo, match, 992 return cmdutil.forget(self.ui, self._repo, match,
991 self.wvfs.reljoin(prefix, self._path), True) 993 self.wvfs.reljoin(prefix, self._path), True)
992 994
993 @annotatesubrepoerror 995 @annotatesubrepoerror
994 def removefiles(self, matcher, prefix, after, force, subrepos): 996 def removefiles(self, matcher, prefix, after, force, subrepos, warnings):
995 return cmdutil.remove(self.ui, self._repo, matcher, 997 return cmdutil.remove(self.ui, self._repo, matcher,
996 self.wvfs.reljoin(prefix, self._path), 998 self.wvfs.reljoin(prefix, self._path),
997 after, force, subrepos) 999 after, force, subrepos)
998 1000
999 @annotatesubrepoerror 1001 @annotatesubrepoerror