Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.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 | d1fccbd50fcd |
children | b9b968e21f78 |
comparison
equal
deleted
inserted
replaced
36635:4de15c54e59f | 36636:c6061cadb400 |
---|---|
44 from . import ( | 44 from . import ( |
45 hgweb_mod, | 45 hgweb_mod, |
46 webutil, | 46 webutil, |
47 wsgicgi, | 47 wsgicgi, |
48 ) | 48 ) |
49 from ..utils import dateutil | |
49 | 50 |
50 def cleannames(items): | 51 def cleannames(items): |
51 return [(util.pconvert(name).strip('/'), path) for name, path in items] | 52 return [(util.pconvert(name).strip('/'), path) for name, path in items] |
52 | 53 |
53 def findrepos(paths): | 54 def findrepos(paths): |
374 | 375 |
375 # show either a directory entry or a repository | 376 # show either a directory entry or a repository |
376 if directory: | 377 if directory: |
377 # get the directory's time information | 378 # get the directory's time information |
378 try: | 379 try: |
379 d = (get_mtime(path), util.makedate()[1]) | 380 d = (get_mtime(path), dateutil.makedate()[1]) |
380 except OSError: | 381 except OSError: |
381 continue | 382 continue |
382 | 383 |
383 # add '/' to the name to make it obvious that | 384 # add '/' to the name to make it obvious that |
384 # the entry is a directory, not a regular repository | 385 # the entry is a directory, not a regular repository |
423 continue | 424 continue |
424 except error.RepoError: | 425 except error.RepoError: |
425 u.warn(_('error accessing repository at %s\n') % path) | 426 u.warn(_('error accessing repository at %s\n') % path) |
426 continue | 427 continue |
427 try: | 428 try: |
428 d = (get_mtime(r.spath), util.makedate()[1]) | 429 d = (get_mtime(r.spath), dateutil.makedate()[1]) |
429 except OSError: | 430 except OSError: |
430 continue | 431 continue |
431 | 432 |
432 contact = get_contact(get) | 433 contact = get_contact(get) |
433 description = get("web", "description") | 434 description = get("web", "description") |