diff mercurial/subrepo.py @ 23537:f1b06a8aad42

commit: propagate --addremove to subrepos if -S is specified (issue3759) The recursive addremove operation occurs completely before the first subrepo is committed. Only hg subrepos support the addremove operation at the moment- svn and git subrepos will warn and abort the commit.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 24 Nov 2014 22:27:49 -0500
parents fcbc66b5da6a
children f274d27f1994
line wrap: on
line diff
--- a/mercurial/subrepo.py	Wed Nov 26 16:13:38 2014 -0500
+++ b/mercurial/subrepo.py	Mon Nov 24 22:27:49 2014 -0500
@@ -437,6 +437,10 @@
     def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly):
         return []
 
+    def addremove(self, matcher, prefix, opts, dry_run, similarity):
+        self._ui.warn("%s: %s" % (prefix, _("addremove is not supported")))
+        return 1
+
     def cat(self, ui, match, prefix, **opts):
         return 1
 
@@ -619,6 +623,11 @@
         return cmdutil.add(ui, self._repo, match, dryrun, listsubrepos,
                            os.path.join(prefix, self._path), explicitonly)
 
+    def addremove(self, m, prefix, opts, dry_run, similarity):
+        return scmutil.addremove(self._repo, m,
+                                 os.path.join(prefix, self._path), opts,
+                                 dry_run, similarity)
+
     @annotatesubrepoerror
     def cat(self, ui, match, prefix, **opts):
         rev = self._state[1]