/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/transform.py

  • Committer: Neil Santos
  • Date: 2010-03-04 02:43:41 UTC
  • mto: (5080.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5081.
  • Revision ID: neil_santos@users.sourceforge.net-20100304024341-ra7njxj4lzjb46rl
Removed separate lstat() and reverted LocalTransport and SFTPTransport's stat() methods to using lstat() internally.
Reworked how SFTPTransport's symlink() handles success and signals failure.
Removed lstat() declaration on the Transport base class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    )
36
36
""")
37
37
from bzrlib.errors import (DuplicateKey, MalformedTransform, NoSuchFile,
38
 
                           ReusingTransform, CantMoveRoot,
 
38
                           ReusingTransform, NotVersionedError, CantMoveRoot,
39
39
                           ExistingLimbo, ImmortalLimbo, NoFinalPath,
40
40
                           UnableCreateSymlink)
41
41
from bzrlib.filters import filtered_output_bytes, ContentFilterContext
1160
1160
            if trans_id not in self._new_contents:
1161
1161
                continue
1162
1162
            new_path = self._limbo_name(trans_id)
1163
 
            osutils.rename(old_path, new_path)
 
1163
            os.rename(old_path, new_path)
1164
1164
            for descendant in self._limbo_descendants(trans_id):
1165
1165
                desc_path = self._limbo_files[descendant]
1166
1166
                desc_path = new_path + desc_path[len(old_path):]
2824
2824
                        # special-case the other tree root (move its
2825
2825
                        # children to current root)
2826
2826
                        if entry.parent_id is None:
2827
 
                            create = False
 
2827
                            create=False
2828
2828
                            moved = _reparent_transform_children(
2829
2829
                                tt, trans_id, tt.root)
2830
2830
                            for child in moved:
2898
2898
        self.pending_deletions = []
2899
2899
 
2900
2900
    def rename(self, from_, to):
2901
 
        """Rename a file from one path to another."""
 
2901
        """Rename a file from one path to another.  Functions like os.rename"""
2902
2902
        try:
2903
 
            osutils.rename(from_, to)
 
2903
            os.rename(from_, to)
2904
2904
        except OSError, e:
2905
2905
            if e.errno in (errno.EEXIST, errno.ENOTEMPTY):
2906
2906
                raise errors.FileExists(to, str(e))
2920
2920
    def rollback(self):
2921
2921
        """Reverse all renames that have been performed"""
2922
2922
        for from_, to in reversed(self.past_renames):
2923
 
            osutils.rename(to, from_)
 
2923
            os.rename(to, from_)
2924
2924
        # after rollback, don't reuse _FileMover
2925
2925
        past_renames = None
2926
2926
        pending_deletions = None