[merge] updated store-escaping for windows

John A Meinel john at arbash-meinel.com
Fri Apr 14 01:46:34 BST 2006


Martin Pool wrote:
> On 14/04/2006, at 1:36 AM, John A Meinel wrote:
> 
>> That was a hack to make the "executable" bit work correctly. Aaron's
>> latest TreeTransform stuff does it correctly. So please revert the
>> signature to 4 entries rather than my 5. It never covered all cases, but
>> did allow for checking out bzr on a win32 machine, without it setting
>> the executable bit to false for everything.
> 
> Yes, I did that - thanks for confirming it.
> 
> --Martin
> 

Speaking of this, there is still a small issue with how bzr handles the
executable bit on windows. I sent a bug report to Aaron, but I don't
think the rest of the list got it.

Basically, if you are in a win32 tree it only corrects files who had the
wrong information previously. So in the bzr tree, if you issue 'bzr
revert' if it had correctly set the executable bit for say 'bzr', then
it would be incorrect. If you run 'revert' again, it will be correct. A
third time, and it will be incorrect.

The fix I put together was fairly simple:
=== modified file 'a/bzrlib/transform.py'
--- a/bzrlib/transform.py
+++ b/bzrlib/transform.py
@@ -15,6 +15,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 import os
+import sys
 import errno
 from stat import S_ISREG

@@ -1006,8 +1007,10 @@
         create_by_entry(tt, entry, target_tree, e_trans_id,
mode_id=mode_id)
         create_entry_executability(tt, entry, e_trans_id)

-    elif meta_mod:
-        tt.set_executability(entry.executable, e_trans_id)
+    elif meta_mod or sys.platform == 'win32':
+        executable = getattr(entry, 'executable', None)
+        if executable is not None:
+            tt.set_executability(executable, e_trans_id)
     if tt.final_name(e_trans_id) != entry.name:
         adjust_path  = True
     else:


(It seems some objects don't have a 'executable' attribute, maybe
directories?)

Anyway, the above fixes the problem, though I think Aaron thought the
real bug was somewhere else, since it should just be reading the working
inventory and not modifying it. (Whereas it is actually losing the
executable bit somehow).

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060413/83ebb8d3/attachment.pgp 


More information about the bazaar mailing list