Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/changelog.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 | ddeb7653b31c |
children | f0b6fbea00cf |
comparison
equal
deleted
inserted
replaced
36635:4de15c54e59f | 36636:c6061cadb400 |
---|---|
22 error, | 22 error, |
23 pycompat, | 23 pycompat, |
24 revlog, | 24 revlog, |
25 util, | 25 util, |
26 ) | 26 ) |
27 from .utils import dateutil | |
27 | 28 |
28 _defaultextra = {'branch': 'default'} | 29 _defaultextra = {'branch': 'default'} |
29 | 30 |
30 def _string_escape(text): | 31 def _string_escape(text): |
31 """ | 32 """ |
522 % pycompat.bytestr(user)) | 523 % pycompat.bytestr(user)) |
523 | 524 |
524 desc = stripdesc(desc) | 525 desc = stripdesc(desc) |
525 | 526 |
526 if date: | 527 if date: |
527 parseddate = "%d %d" % util.parsedate(date) | 528 parseddate = "%d %d" % dateutil.parsedate(date) |
528 else: | 529 else: |
529 parseddate = "%d %d" % util.makedate() | 530 parseddate = "%d %d" % dateutil.makedate() |
530 if extra: | 531 if extra: |
531 branch = extra.get("branch") | 532 branch = extra.get("branch") |
532 if branch in ("default", ""): | 533 if branch in ("default", ""): |
533 del extra["branch"] | 534 del extra["branch"] |
534 elif branch in (".", "null", "tip"): | 535 elif branch in (".", "null", "tip"): |