changeset 3805:299d6cce6c0b

add debugdate command
author Matt Mackall <mpm@selenic.com>
date Wed, 06 Dec 2006 13:13:25 -0600
parents 302ffecdd726
children 92a3532a01d9
files mercurial/commands.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):