[PATCH 1 of 1] revert: show warning when reverting subrepos that do not support revert

Angel Ezquerra angel.ezquerra at gmail.com
Thu Apr 19 06:30:29 CDT 2012


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1334871402 -7200
# Branch stable
# Node ID dd503bd8d629415cafb2dd426862669a30eec2e8
# Parent  09dd707b522a766b7d5e5fd221c4e68ac735f4d9
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

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -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):


More information about the Mercurial-devel mailing list