[MERGE] make "diff" detail property changes

Aaron Bentley aaron at aaronbentley.com
Thu Mar 13 12:37:50 GMT 2008


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

Alexander Belchenko wrote:
> James Westby пишет:
>> For the test Chad needs to change the executable property on a file,
>> and then check that diff displays this change in the way that he wants.
>>
>> There is no test that currently does this.

Not diff specifically, but there are certainly cross-platform tests for
the execute bit.  They use TreeTranform to set it.

> Can you explain how to
>> change the property on a file on Windows please?
> 
> http://bazaar.launchpad.net/~bialix/bzr-x-bit/trunk/annotate/bialix%40ukr.net-20070328093543-blbtmf3k7jp6bmsd?file_id=__init__.py-20060516204016-5be79f11e31f2cb7

Instead of doing it a Windows-only way or a Unix-only way, I suggest
using TreeTransform so it's cross-platform.  Here's how to create a file
with the execute bit set:

        tree = self.make_branch_and_tree('tree')
        tt = transform.TreeTransform(tree)
        tt.new_file('newfile', tt.root, 'helooo!', 'newfile-id', True)
        tt.apply()

You can use TreeTransform.set_executability to change the execute bit.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH2SAe0F+nu1YWqI0RAvHVAKCIkH2ZpwRwtWIBozFH94MPb8y+hACfWi9r
zhJvDpfUuwAPYcJ0wCJ+Fj4=
=noDK
-----END PGP SIGNATURE-----



More information about the bazaar mailing list