D2282: util: extract all date-related utils in utils/dateutil module

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Fri Feb 16 03:54:11 EST 2018


lothiraldan added a comment.


  In https://phab.mercurial-scm.org/D2282#37751, @dlax wrote:
  
  > Having both a `util` module and a `utils` package looks weird.
  >  Have you considered moving `util.py` into `util/__init__.py` and then adding new modules under `util` package?
  
  
  I have but I'm always very cautious when creating a new package with the name of an old module. .pyc/.pycache files may still be there both for Mercurial developers and for Mercurial users using their deb/rpm package.
  
  I may be wrong, but if we could avoid weird bugs, I would prefer put in the `utils` package.
  
  I could have also copy `util.py` as `utils/__init__.py` but then I would have to update basically all Mercurial Python source files.

INLINE COMMENTS

> martinvonz wrote in dateutil.py:14-19
> What else do you foresee moving into the util/ directory? Perhaps these?

I'm thinking maybe:

- All net related functions in netutil.py
- All paths related functions in pathutil.py
- All cache related functions in cacheutil.py

REPOSITORY
  rHG Mercurial

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

To: lothiraldan, #hg-reviewers
Cc: dlax, martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list