diff mercurial/debugcommands.py @ 36636:c6061cadb400

util: extract all date-related utils in utils/dateutil module With this commit, util.py lose 262 lines Note for extensions author, if this commit breaks your extension, you can pull the step-by-step split here to help you more easily pinpoint the renaming that broke your extension: hg pull https://bitbucket.org/octobus/mercurial-devel/ -r ac1f6453010d Differential Revision: https://phab.mercurial-scm.org/D2282
author Boris Feld <boris.feld@octobus.net>
date Thu, 15 Feb 2018 17:18:26 +0100
parents dfcf589a4031
children 390d16ea7c76
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Thu Feb 08 23:27:24 2018 +0530
+++ b/mercurial/debugcommands.py	Thu Feb 15 17:18:26 2018 +0100
@@ -77,6 +77,7 @@
     vfs as vfsmod,
     wireprotoserver,
 )
+from .utils import dateutil
 
 release = lockmod.release
 
@@ -560,13 +561,13 @@
 def debugdate(ui, date, range=None, **opts):
     """parse and display a date"""
     if opts[r"extended"]:
-        d = util.parsedate(date, util.extendeddateformats)
+        d = dateutil.parsedate(date, util.extendeddateformats)
     else:
-        d = util.parsedate(date)
+        d = dateutil.parsedate(date)
     ui.write(("internal: %d %d\n") % d)
-    ui.write(("standard: %s\n") % util.datestr(d))
+    ui.write(("standard: %s\n") % dateutil.datestr(d))
     if range:
-        m = util.matchdate(range)
+        m = dateutil.matchdate(range)
         ui.write(("match: %s\n") % m(d[0]))
 
 @command('debugdeltachain',
@@ -1578,7 +1579,7 @@
             try:
                 date = opts.get('date')
                 if date:
-                    date = util.parsedate(date)
+                    date = dateutil.parsedate(date)
                 else:
                     date = None
                 prec = parsenodeid(precursor)