add debugdate command
authorMatt Mackall <mpm@selenic.com>
Wed, 06 Dec 2006 13:13:25 -0600
changeset 3805 299d6cce6c0b
parent 3804 302ffecdd726
child 3806 92a3532a01d9
add debugdate command
mercurial/commands.py
--- a/mercurial/commands.py	Wed Dec 06 12:45:27 2006 -0600
+++ b/mercurial/commands.py	Wed Dec 06 13:13:25 2006 -0600
@@ -788,6 +788,12 @@
     except KeyError:
         raise util.Abort(_('invalid revision identifier %s') % rev)
 
+def debugdate(ui, date):
+    """parse and display a date"""
+    d = util.parsedate(date)
+    ui.write("internal: %s %s\n" % d)
+    ui.write("standard: %s\n" % util.datestr(d))
+
 def debugindex(ui, file_):
     """dump the contents of an index file"""
     r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_, "", 0)
@@ -2477,6 +2483,7 @@
     "debugcheckstate": (debugcheckstate, [], _('debugcheckstate')),
     "debugsetparents": (debugsetparents, [], _('debugsetparents REV1 [REV2]')),
     "debugstate": (debugstate, [], _('debugstate')),
+    "debugdate": (debugdate, [], _('debugdata DATE')),
     "debugdata": (debugdata, [], _('debugdata FILE REV')),
     "debugindex": (debugindex, [], _('debugindex FILE')),
     "debugindexdot": (debugindexdot, [], _('debugindexdot FILE')),
@@ -2727,7 +2734,7 @@
 }
 
 norepo = ("clone init version help debugancestor debugcomplete debugdata"
-          " debugindex debugindexdot")
+          " debugindex debugindexdot debugdate")
 optionalrepo = ("paths serve showconfig")
 
 def findpossible(ui, cmd):