diff mercurial/subrepo.py @ 12166:441a74b8def1

status: recurse into subrepositories with --subrepos/-S flag
author Martin Geisler <mg@lazybytes.net>
date Fri, 03 Sep 2010 12:58:51 +0200
parents af8c4929931c
children d2c5b0927c28
line wrap: on
line diff
--- a/mercurial/subrepo.py	Fri Sep 03 12:58:51 2010 +0200
+++ b/mercurial/subrepo.py	Fri Sep 03 12:58:51 2010 +0200
@@ -246,6 +246,9 @@
         raise NotImplementedError
 
 
+    def status(self, rev2, **opts):
+        return [], [], [], [], [], [], []
+
 class hgsubrepo(abstractsubrepo):
     def __init__(self, ctx, path, state):
         self._path = path
@@ -275,6 +278,17 @@
                 addpathconfig('default-push', defpushpath)
             fp.close()
 
+    def status(self, rev2, **opts):
+        try:
+            rev1 = self._state[1]
+            ctx1 = self._repo[rev1]
+            ctx2 = self._repo[rev2]
+            return self._repo.status(ctx1, ctx2, **opts)
+        except error.RepoLookupError, inst:
+            self._repo.ui.warn(_("warning: %s in %s\n")
+                               % (inst, relpath(self)))
+            return [], [], [], [], [], [], []
+
     def dirty(self):
         r = self._state[1]
         if r == '':