post_transform_hook syntax etc

John Arbash Meinel john at arbash-meinel.com
Thu May 17 12:58:36 UTC 2012


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

On 5/17/2012 2:39 PM, phil wigglesworth wrote:
> I'm trying to work around a problem 
> <https://bugs.launchpad.net/bzr/+bug/997933> (997933) in Bazaar
> (bzrlib 2.5.0). The defect causes Bazaar to trample on inherited
> file permissions on files in Win7-64, so that when anyone in the
> team changes anything, everyone else gets "file permission" errors
> on that changed file. That defect report is not the subject of this
> post, the work-around is.
> 
> My problem working around that defect is how to create a "post
> transform hook", which as far as I can see 
> <https://code.launchpad.net/%7Ejelmer/bzr/transform-hooks/+merge/89007>
>
> 
is present in 2.5 of the bzr library (I'm using 2.5.0).
> 
> Syntax-wise I have this in my hook file:
> 
> from bzrlib import branch
> 
> def post_transform_hook(): print "post_transform_hook"
> 
> branch.Branch.hooks.install_named_hook('post_transform', 
> post_transform_hook, 'My post_transform hook')

post_transform is not a branch hook, it is a mutable tree hook.

from bzrlib import mutabletree

def post_transform_hook(tree, transform):
  print 'post_transform_hook'

mutabletree.MutableTree.hooks.install_named_hook('post_transform', ...)

I don't know a lot about the details, but that should get you closer
to what you want.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+09fwACgkQJdeBCYSNAAP2EACguw3Y2vIPxo2qUY9/w50bXS82
aP4An35ztzAGiUDVTN6F08AX+GoFP0P9
=g8kf
-----END PGP SIGNATURE-----



More information about the bazaar mailing list