Mercurial > public > mercurial-scm > hg
comparison mercurial/obsolete.py @ 36607: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 | 2831d918e1b4 |
children | b9bbcf9ffac1 |
comparison
equal
deleted
inserted
replaced
36606:4de15c54e59f | 36607:c6061cadb400 |
---|---|
79 obsutil, | 79 obsutil, |
80 phases, | 80 phases, |
81 policy, | 81 policy, |
82 util, | 82 util, |
83 ) | 83 ) |
84 from .utils import dateutil | |
84 | 85 |
85 parsers = policy.importmod(r'parsers') | 86 parsers = policy.importmod(r'parsers') |
86 | 87 |
87 _pack = struct.pack | 88 _pack = struct.pack |
88 _unpack = struct.unpack | 89 _unpack = struct.unpack |
599 if metadata is None: | 600 if metadata is None: |
600 metadata = {} | 601 metadata = {} |
601 if date is None: | 602 if date is None: |
602 if 'date' in metadata: | 603 if 'date' in metadata: |
603 # as a courtesy for out-of-tree extensions | 604 # as a courtesy for out-of-tree extensions |
604 date = util.parsedate(metadata.pop('date')) | 605 date = dateutil.parsedate(metadata.pop('date')) |
605 elif ui is not None: | 606 elif ui is not None: |
606 date = ui.configdate('devel', 'default-date') | 607 date = ui.configdate('devel', 'default-date') |
607 if date is None: | 608 if date is None: |
608 date = util.makedate() | 609 date = dateutil.makedate() |
609 else: | 610 else: |
610 date = util.makedate() | 611 date = dateutil.makedate() |
611 if len(prec) != 20: | 612 if len(prec) != 20: |
612 raise ValueError(prec) | 613 raise ValueError(prec) |
613 for succ in succs: | 614 for succ in succs: |
614 if len(succ) != 20: | 615 if len(succ) != 20: |
615 raise ValueError(succ) | 616 raise ValueError(succ) |