/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-21 21:39:33 UTC
  • mfrom: (5102 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5143.
  • Revision ID: jelmer@samba.org-20100321213933-fexeh9zcoz8oaju2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd.
 
1
# Copyright (C) 2005-2010 Canonical Ltd.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
31
31
from bzrlib import (
32
32
    branch as _mod_branch,
33
33
    bzrdir,
34
 
    commands,
 
34
    cmdline,
35
35
    errors,
36
36
    osutils,
37
37
    patiencediff,
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
 
680
683
    @classmethod
681
684
    def from_string(klass, command_string, old_tree, new_tree, to_file,
682
685
                    path_encoding='utf-8'):
683
 
        command_template = commands.shlex_split_unicode(command_string)
 
686
        command_template = cmdline.split(command_string)
684
687
        if '@' not in command_string:
685
688
            command_template.extend(['@old_path', '@new_path'])
686
689
        return klass(command_template, old_tree, new_tree, to_file,
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