Show More
@@ -8,7 +8,7 b'' | |||||
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") |
|
11 | demandload(globals(), "os re sys signal shutil imp urllib pdb stat") | |
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") | |
@@ -379,11 +379,22 b' def dodiff(fp, ui, repo, node1, node2, f' | |||||
379 | if node2: |
|
379 | if node2: | |
380 | change = repo.changelog.read(node2) |
|
380 | change = repo.changelog.read(node2) | |
381 | mmap2 = repo.manifest.read(change[0]) |
|
381 | mmap2 = repo.manifest.read(change[0]) | |
382 | date2 = util.datestr(change[2]) |
|
382 | _date2 = util.datestr(change[2]) | |
|
383 | def date2(f): | |||
|
384 | return _date2 | |||
383 | def read(f): |
|
385 | def read(f): | |
384 | return repo.file(f).read(mmap2[f]) |
|
386 | return repo.file(f).read(mmap2[f]) | |
385 | else: |
|
387 | else: | |
386 | date2 = util.datestr() |
|
388 | _date2 = util.datestr() | |
|
389 | _tz = util.makedate()[1] | |||
|
390 | def date2(f): | |||
|
391 | try: | |||
|
392 | _f = repo.wopener(f) | |||
|
393 | except IOError, err: | |||
|
394 | if err[0] != errno.ENOENT: | |||
|
395 | raise | |||
|
396 | return _date2 | |||
|
397 | return util.datestr((os.fstat(_f.fileno())[stat.ST_MTIME], _tz)) | |||
387 | def read(f): |
|
398 | def read(f): | |
388 | return repo.wread(f) |
|
399 | return repo.wread(f) | |
389 |
|
400 | |||
@@ -401,17 +412,17 b' def dodiff(fp, ui, repo, node1, node2, f' | |||||
401 | if f in mmap: |
|
412 | if f in mmap: | |
402 | to = repo.file(f).read(mmap[f]) |
|
413 | to = repo.file(f).read(mmap[f]) | |
403 | tn = read(f) |
|
414 | tn = read(f) | |
404 | fp.write(mdiff.unidiff(to, date1, tn, date2, f, r, text=text, |
|
415 | fp.write(mdiff.unidiff(to, date1, tn, date2(f), f, r, text=text, | |
405 | showfunc=showfunc, ignorews=ignorews)) |
|
416 | showfunc=showfunc, ignorews=ignorews)) | |
406 | for f in added: |
|
417 | for f in added: | |
407 | to = None |
|
418 | to = None | |
408 | tn = read(f) |
|
419 | tn = read(f) | |
409 | fp.write(mdiff.unidiff(to, date1, tn, date2, f, r, text=text, |
|
420 | fp.write(mdiff.unidiff(to, date1, tn, date2(f), f, r, text=text, | |
410 | showfunc=showfunc, ignorews=ignorews)) |
|
421 | showfunc=showfunc, ignorews=ignorews)) | |
411 | for f in removed: |
|
422 | for f in removed: | |
412 | to = repo.file(f).read(mmap[f]) |
|
423 | to = repo.file(f).read(mmap[f]) | |
413 | tn = None |
|
424 | tn = None | |
414 | fp.write(mdiff.unidiff(to, date1, tn, date2, f, r, text=text, |
|
425 | fp.write(mdiff.unidiff(to, date1, tn, date2(f), f, r, text=text, | |
415 | showfunc=showfunc, ignorews=ignorews)) |
|
426 | showfunc=showfunc, ignorews=ignorews)) | |
416 |
|
427 | |||
417 | def trimuser(ui, name, rev, revcache): |
|
428 | def trimuser(ui, name, rev, revcache): |
General Comments 0
You need to be logged in to leave comments.
Login now