post_transform_hook syntax etc

Martin Packman martin.packman at canonical.com
Thu May 17 13:15:04 UTC 2012


On 17/05/2012, phil wigglesworth <philip.wigglesworth at gmail.com> wrote:
>
> Does anyone know what the problem is? I've no real idea of how this stuff
> works, so I may have the wrong "import" or something like that, for all I
> know, although similar syntax to the above works ok for push and pull. Does
> anyone have an example of a post_transform hook I can crib from?

As John mentioned, it's just that the hook point in on MutableTree not
Branch. Try <lp:~gz/+junk/treetransform_hook_example> for starting
off.

> Once I have the hook working without error, I'll need a list of the files
> which have changed (been "transformed" I guess) - can anyone tell me where
> I can find anything to tell me what parameters may be available to get that
> list and iterate it? All I'm going to do is set the "include inheritable
> permissions from this object's parent" flag for each file changed, which
> solves our problem.

Having looked again, this seems like it might be a little more
painful, as I'm not sure of how you get the changes just made from a
tree transform, so post_transform doesn't tell you which files were
changed. In pre_transform, you can get the changes due to happen with
iter_changes, see the docstring on InterTree.iter_changes in
bzrlib/tree.py for the format. Not sure the best way forward from
there, either stash the info and act on it in post_transform, or edit
the transform somehow. Jelmer or Vincent may have better ideas.

Martin



More information about the bazaar mailing list