/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/diff.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import string
23
23
import sys
24
24
 
25
 
from bzrlib.lazy_import import lazy_import
 
25
from .lazy_import import lazy_import
26
26
lazy_import(globals(), """
27
27
import errno
28
28
import subprocess
29
29
import tempfile
30
30
 
31
 
from bzrlib import (
 
31
from breezy import (
32
32
    cleanup,
33
33
    cmdline,
34
34
    controldir,
40
40
    views,
41
41
    )
42
42
 
43
 
from bzrlib.workingtree import WorkingTree
44
 
from bzrlib.i18n import gettext
 
43
from breezy.workingtree import WorkingTree
 
44
from breezy.i18n import gettext
45
45
""")
46
46
 
47
 
from bzrlib.registry import (
 
47
from .registry import (
48
48
    Registry,
49
49
    )
50
 
from bzrlib.trace import mutter, note, warning
 
50
from .trace import mutter, note, warning
51
51
 
52
52
DEFAULT_CONTEXT_AMOUNT = 3
53
53
 
147
147
                                stdout=subprocess.PIPE,
148
148
                                stderr=stderr,
149
149
                                env=env)
150
 
    except OSError, e:
 
150
    except OSError as e:
151
151
        if e.errno == errno.ENOENT:
152
152
            raise errors.NoDiff(str(e))
153
153
        raise
293
293
            # deleted)
294
294
            try:
295
295
                os.remove(path)
296
 
            except OSError, e:
 
296
            except OSError as e:
297
297
                if e.errno not in (errno.ENOENT,):
298
298
                    warning('Failed to delete temporary file: %s %s', path, e)
299
299
 
751
751
        try:
752
752
            proc = subprocess.Popen(command, stdout=subprocess.PIPE,
753
753
                                    cwd=self._root)
754
 
        except OSError, e:
 
754
        except OSError as e:
755
755
            if e.errno == errno.ENOENT:
756
756
                raise errors.ExecutableMissing(command[0])
757
757
            else:
765
765
            return False
766
766
        try:
767
767
            os.symlink(tree.abspath(''), osutils.pathjoin(self._root, prefix))
768
 
        except OSError, e:
 
768
        except OSError as e:
769
769
            if e.errno != errno.EEXIST:
770
770
                raise
771
771
        return True
811
811
        parent_dir = osutils.dirname(full_path)
812
812
        try:
813
813
            os.makedirs(parent_dir)
814
 
        except OSError, e:
 
814
        except OSError as e:
815
815
            if e.errno != errno.EEXIST:
816
816
                raise
817
817
        source = tree.get_file(file_id, relpath)
845
845
    def finish(self):
846
846
        try:
847
847
            osutils.rmtree(self._root)
848
 
        except OSError, e:
 
848
        except OSError as e:
849
849
            if e.errno != errno.ENOENT:
850
850
                mutter("The temporary directory \"%s\" was not "
851
851
                        "cleanly removed: %s." % (self._root, e))