Patchwork D7520: dateutil: correct default for Ymd in parsedate

login
register
mail settings
Submitter phabricator
Date Nov. 26, 2019, 2:48 p.m.
Message ID <a2c9c7a5d0db317094c09e1c756451b9@localhost.localdomain>
Download mbox | patch
Permalink /patch/43522/
State Not Applicable
Headers show

Comments

phabricator - Nov. 26, 2019, 2:48 p.m.
Closed by commit rHGaef7b91dba51: dateutil: correct default for Ymd in parsedate (authored by quark).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7520?vs=18392&id=18396

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7520/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7520

AFFECTED FILES
  mercurial/utils/dateutil.py

CHANGE DETAILS




To: quark, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/utils/dateutil.py b/mercurial/utils/dateutil.py
--- a/mercurial/utils/dateutil.py
+++ b/mercurial/utils/dateutil.py
@@ -209,6 +209,8 @@ 
     True
     >>> tz == strtz
     True
+    >>> parsedate(b'2000 UTC', formats=extendeddateformats)
+    (946684800, 0)
     """
     if bias is None:
         bias = {}
@@ -244,7 +246,8 @@ 
                 if part[0:1] in b"HMS":
                     b = b"00"
                 else:
-                    b = b"0"
+                    # year, month, and day start from 1
+                    b = b"1"
 
             # this piece is for matching the generic end to today's date
             n = datestr(now, b"%" + part[0:1])