Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/commands.py @ 2461:ff9ee834e3b6
tidy up mtime patch of andrea, get back half of performance loss.
this makes diff < 3% slower than before.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Tue, 20 Jun 2006 09:11:41 -0700 |
parents | 605e26a2e96e |
children | 30c267cb4c2f |
comparison
equal
deleted
inserted
replaced
2460:605e26a2e96e | 2461:ff9ee834e3b6 |
---|---|
6 # of the GNU General Public License, incorporated herein by reference. | 6 # of the GNU General Public License, incorporated herein by reference. |
7 | 7 |
8 from demandload import demandload | 8 from demandload import demandload |
9 from node import * | 9 from node import * |
10 from i18n import gettext as _ | 10 from i18n import gettext as _ |
11 demandload(globals(), "os re sys signal shutil imp urllib pdb stat") | 11 demandload(globals(), "os re sys signal shutil imp urllib pdb") |
12 demandload(globals(), "fancyopts ui hg util lock revlog templater bundlerepo") | 12 demandload(globals(), "fancyopts ui hg util lock revlog templater bundlerepo") |
13 demandload(globals(), "fnmatch mdiff random signal tempfile time") | 13 demandload(globals(), "fnmatch mdiff random signal tempfile time") |
14 demandload(globals(), "traceback errno socket version struct atexit sets bz2") | 14 demandload(globals(), "traceback errno socket version struct atexit sets bz2") |
15 demandload(globals(), "archival changegroup") | 15 demandload(globals(), "archival changegroup") |
16 demandload(globals(), "hgweb.server sshserver") | 16 demandload(globals(), "hgweb.server sshserver") |
383 def date2(f): | 383 def date2(f): |
384 return _date2 | 384 return _date2 |
385 def read(f): | 385 def read(f): |
386 return repo.file(f).read(mmap2[f]) | 386 return repo.file(f).read(mmap2[f]) |
387 else: | 387 else: |
388 tz = util.makedate()[1] | |
388 _date2 = util.datestr() | 389 _date2 = util.datestr() |
389 _tz = util.makedate()[1] | |
390 def date2(f): | 390 def date2(f): |
391 try: | 391 try: |
392 _f = repo.wopener(f) | 392 return util.datestr((os.lstat(repo.wjoin(f)).st_mtime, tz)) |
393 except IOError, err: | 393 except IOError, err: |
394 if err[0] != errno.ENOENT: | 394 if err.errno != errno.ENOENT: raise |
395 raise | |
396 return _date2 | 395 return _date2 |
397 return util.datestr((os.fstat(_f.fileno())[stat.ST_MTIME], _tz)) | |
398 def read(f): | 396 def read(f): |
399 return repo.wread(f) | 397 return repo.wread(f) |
400 | 398 |
401 if ui.quiet: | 399 if ui.quiet: |
402 r = None | 400 r = None |