~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-09-23 09:25:16 UTC
  • mto: (1092.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: robertc@robertcollins.net-20050923092516-e2c3c0f31288669d
Merge what applied of Alexander Belchenko's win32 patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import bzrlib
22
22
from bzrlib.trace import mutter, note
23
23
from bzrlib.osutils import isdir, quotefn, compact_date, rand_bytes, \
24
 
     splitpath, \
25
 
     sha_file, appendpath, file_kind
 
24
     rename, splitpath, sha_file, appendpath, file_kind
26
25
 
27
26
from bzrlib.errors import BzrError, InvalidRevisionNumber, InvalidRevisionId, \
28
27
     DivergedBranches, NotBranchError
988
987
            from_abs = self.abspath(from_rel)
989
988
            to_abs = self.abspath(to_rel)
990
989
            try:
991
 
                os.rename(from_abs, to_abs)
 
990
                rename(from_abs, to_abs)
992
991
            except OSError, e:
993
992
                raise BzrError("failed to rename %r to %r: %s"
994
993
                        % (from_abs, to_abs, e[1]),
1057
1056
                result.append((f, dest_path))
1058
1057
                inv.rename(inv.path2id(f), to_dir_id, name_tail)
1059
1058
                try:
1060
 
                    os.rename(self.abspath(f), self.abspath(dest_path))
 
1059
                    rename(self.abspath(f), self.abspath(dest_path))
1061
1060
                except OSError, e:
1062
1061
                    raise BzrError("failed to rename %r to %r: %s" % (f, dest_path, e[1]),
1063
1062
                            ["rename rolled back"])
1242
1241
        """
1243
1242
        >>> orig = ScratchBranch(files=["file1", "file2"])
1244
1243
        >>> clone = orig.clone()
1245
 
        >>> os.path.samefile(orig.base, clone.base)
 
1244
        >>> if os.name != 'nt':
 
1245
        ...   os.path.samefile(orig.base, clone.base)
 
1246
        ... else:
 
1247
        ...   orig.base == clone.base
 
1248
        ...
1246
1249
        False
1247
1250
        >>> os.path.isfile(os.path.join(clone.base, "file1"))
1248
1251
        True