[MERGE][#149113] Fix handling of executable=None

John Arbash Meinel john at arbash-meinel.com
Tue Oct 16 22:33:46 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is a patch which at least works around the problem in:
https://bugs.launchpad.net/bzr/+bug/149113

Specifically, it changes record_entry_contents so that if path_content_summary
returns None then it uses the policy of the last parent's value, or False if
there is no parent.

It fixes the bug, which makes 'bzr commit' work again on Win32, and I'm
guessing it fixes a lot of Alexander's failing tests.

There are a few issues, though.

a) path_content_summary calls supports_executable() for every call. This seems
a bit wasteful for something that cannot change.

b) This always picks the first parent, which means it isn't possible to merge
in a change to the executable bit. Nor is a plugin like Alexander's (which
allows you to toggle the bit on win32) possible.

I believe the "correct" fix is to return the value stored in the
DirState/current inventory, which is what we did in the past. I didn't do it
that way, because the code in question says:

            if not supports_executable():
                executable = None # caller can decide policy.
            else:
                mode = stat_result.st_mode
                executable = bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)


Which seems to be that Robert intended for executable to be None.
So instead I focused on at least getting ie.executable set to a valid value.

It may be that we want to take this patch, and then write another one which
updates path_content_summary. (Since it seems that record_entry_contents()
should probably handle the case of summary[2] is None).

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFS46JdeBCYSNAAMRAuW5AKCKSTfIC7qTaArsv6v0FBp8KyOL1QCgyxUC
tc/Fqu6O+W+N0aZ+F8JnNTY=
=hWLa
-----END PGP SIGNATURE-----



More information about the bazaar mailing list