~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Andrew Bennetts
  • Date: 2008-02-18 08:30:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080218083038-tts55zsx5xrz3l2e
Lots of assorted hackery to reduce the number of imports for common operations.  Improves 'rocks', 'st' and 'help' times by ~50ms on my laptop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
 
21
21
from bzrlib import (
22
 
    osutils,
23
22
    symbol_versioning,
24
23
    )
25
24
from bzrlib.patches import (
1761
1760
    _fmt = "Could not move %(from_path)s%(operator)s %(to_path)s%(extra)s"
1762
1761
 
1763
1762
    def __init__(self, from_path='', to_path='', extra=None):
 
1763
        from bzrlib.osutils import splitpath
1764
1764
        BzrError.__init__(self)
1765
1765
        if extra:
1766
1766
            self.extra = ': ' + str(extra)
1770
1770
        has_from = len(from_path) > 0
1771
1771
        has_to = len(to_path) > 0
1772
1772
        if has_from:
1773
 
            self.from_path = osutils.splitpath(from_path)[-1]
 
1773
            self.from_path = splitpath(from_path)[-1]
1774
1774
        else:
1775
1775
            self.from_path = ''
1776
1776
 
1777
1777
        if has_to:
1778
 
            self.to_path = osutils.splitpath(to_path)[-1]
 
1778
            self.to_path = splitpath(to_path)[-1]
1779
1779
        else:
1780
1780
            self.to_path = ''
1781
1781