changeset 1039:4296754ba7b4

Add debugdata for dumping revlog revision data
author mpm@selenic.com
date Wed, 24 Aug 2005 18:40:17 -0700
parents 5f191561a061
children 35e883d1ff9b
files mercurial/commands.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Aug 24 14:46:02 2005 -0700
+++ b/mercurial/commands.py	Wed Aug 24 18:40:17 2005 -0700
@@ -612,6 +612,11 @@
                     time.strftime("%x %X",
                                   time.localtime(dc[file_][3])), file_))
 
+def debugdata(ui, file_, rev):
+    """dump the contents of an data file revision"""
+    r = hg.revlog(hg.opener(""), file_[:-2] + ".i", file_)
+    ui.write(r.revision(r.lookup(rev)))
+
 def debugindex(ui, file_):
     """dump the contents of an index file"""
     r = hg.revlog(hg.opener(""), file_, "")
@@ -1377,6 +1382,7 @@
     "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'),
     "debugconfig": (debugconfig, [], 'debugconfig'),
     "debugstate": (debugstate, [], 'debugstate'),
+    "debugdata": (debugdata, [], 'debugdata FILE REV'),
     "debugindex": (debugindex, [], 'debugindex FILE'),
     "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'),
     "debugwalk":
@@ -1518,7 +1524,8 @@
               ('', 'time', None, 'time how long the command takes'),
              ]
 
-norepo = "clone init version help debugconfig debugindex debugindexdot paths"
+norepo = "clone init version help debugconfig debugdata" + \
+         " debugindex debugindexdot paths"
 
 def find(cmd):
     for e in table.keys():