diff mercurial/commands.py @ 8812:859f841937d0

subrepo: introduce basic state parsing
author Matt Mackall <mpm@selenic.com>
date Mon, 15 Jun 2009 02:45:38 -0500
parents ac92775b3b80
children e87b0fc4750b
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Jun 15 00:03:27 2009 +0200
+++ b/mercurial/commands.py	Mon Jun 15 02:45:38 2009 -0500
@@ -857,6 +857,14 @@
     for f in repo.dirstate.copies():
         ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
 
+def debugsub(ui, repo, rev=None):
+    if rev == '':
+        rev = None
+    for k,v in sorted(repo[rev].substate.items()):
+        ui.write('path %s\n' % k)
+        ui.write(' source   %s\n' % v[0])
+        ui.write(' revision %s\n' % v[1])
+
 def debugdata(ui, file_, rev):
     """dump the contents of a data file revision"""
     r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i")
@@ -3228,6 +3236,10 @@
         (debugstate,
          [('', 'nodates', None, _('do not display the saved mtime'))],
          _('[OPTION]...')),
+    "debugsub":
+        (debugsub,
+         [('r', 'rev', '', _('revision to check'))],
+         _('[-r REV] [REV]')),
     "debugwalk": (debugwalk, walkopts, _('[OPTION]... [FILE]...')),
     "^diff":
         (diff,