Possible Patch: Allow Renaming to Different Case

Michael Cook foobarsoft at foobarsoft.com
Tue Apr 26 00:01:47 BST 2005


I've updated the patch to use os.path.samefile, works just like before 
(except is probably slighly more efficient).

--- ../bzr/bzrlib/branch.py     Thu Apr 14 21:50:23 2005
+++ ./bzrlib/branch.py  Mon Apr 25 17:57:21 2005
@@ -773,7 +773,8 @@
          if not tree.has_filename(from_rel):
              bailout("can't rename: old working file %r does not exist" 
% from_rel)
          if tree.has_filename(to_rel):
-            bailout("can't rename: new working file %r already exists" 
% to_rel)
+            if not os.path.samefile(from_rel, to_rel):
+                bailout("can't rename: new working file %r already 
exists" % to_rel)

          file_id = inv.path2id(from_rel)
          if file_id == None:





More information about the bazaar mailing list