~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-21 02:43:10 UTC
  • mfrom: (4976.1.3 ghost-diffs)
  • Revision ID: pqm@pqm.ubuntu.com-20100121024310-y0jq14xdry72ktxl
(Jelmer) Deal with ghosts in 'bzr diff'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
453
453
 
454
454
def _patch_header_date(tree, file_id, path):
455
455
    """Returns a timestamp suitable for use in a patch header."""
456
 
    mtime = tree.get_file_mtime(file_id, path)
 
456
    try:
 
457
        mtime = tree.get_file_mtime(file_id, path)
 
458
    except errors.FileTimestampUnavailable:
 
459
        mtime = 0
457
460
    return timestamp.format_patch_date(mtime)
458
461
 
459
462
 
747
750
            source.close()
748
751
        if not allow_write:
749
752
            osutils.make_readonly(full_path)
750
 
        mtime = tree.get_file_mtime(file_id)
 
753
        try:
 
754
            mtime = tree.get_file_mtime(file_id)
 
755
        except errors.FileTimestampUnavailable:
 
756
            mtime = 0
751
757
        os.utime(full_path, (mtime, mtime))
752
758
        return full_path
753
759