revert: show warning when reverting subrepos that do not support revert stable
authorAngel Ezquerra <angel.ezquerra@gmail.com>
Thu, 19 Apr 2012 23:36:42 +0200
branchstable
changeset 16468 2fb521d75dc2
parent 16467 7f59900e3f8b
child 16469 dd68c972d089
revert: show warning when reverting subrepos that do not support revert The warning is similar to the warning that was shown before hgsubrepo revert support was added, with the exception that now the subrepo type is shown. For example, when trying to revert a git subrepo located in "include/mygitsub", the warning message would be: include/mygitsub: reverting git subrepos is unsupported
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Wed Apr 18 21:27:35 2012 -0700
+++ b/mercurial/subrepo.py	Thu Apr 19 23:36:42 2012 +0200
@@ -369,6 +369,8 @@
         return []
 
     def revert(self, ui, substate, *pats, **opts):
+        ui.warn('%s: reverting %s subrepos is unsupported\n' \
+            % (substate[0], substate[2]))
         return []
 
 class hgsubrepo(abstractsubrepo):