diff mercurial/subrepo.py @ 15912:2bd54ffaa27e

forget: fix subrepo recursion for explicit path handling When support for handling explicit paths in subrepos was added to the forget command (95174c381525), subrepo recursion wasn't taken into account. This change fixes that by pulling the majority of the logic of commands.forget into cmdutil.forget, which can then be called from both there and subrepo.forget.
author David M. Carr <david@carrclan.us>
date Tue, 17 Jan 2012 19:10:59 -0500
parents c654eac03452
children 04604d1a9fc3
line wrap: on
line diff
--- a/mercurial/subrepo.py	Tue Jan 17 19:10:58 2012 -0500
+++ b/mercurial/subrepo.py	Tue Jan 17 19:10:59 2012 -0500
@@ -360,8 +360,8 @@
         '''
         pass
 
-    def forget(self, files):
-        pass
+    def forget(self, ui, match, prefix):
+        return []
 
 class hgsubrepo(abstractsubrepo):
     def __init__(self, ctx, path, state):
@@ -561,9 +561,9 @@
         ctx = self._repo[None]
         return ctx.walk(match)
 
-    def forget(self, files):
-        ctx = self._repo[None]
-        ctx.forget(files)
+    def forget(self, ui, match, prefix):
+        return cmdutil.forget(ui, self._repo, match,
+                              os.path.join(prefix, self._path), True)
 
 class svnsubrepo(abstractsubrepo):
     def __init__(self, ctx, path, state):