[rfc] Allow action parameter to smart_add to return a file_id
John Arbash Meinel
john at arbash-meinel.com
Wed Jul 19 18:31:51 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
I have a use case of wanting to be able to create a new tree with the
same file ids as another tree (or subset of the other tree). I used to
do this with a custom Action object, which would grab the file id when
it went to add the entry to the inventory.
Since we now always add the object to the inventory (in __add_one), it
would be nice to have ability to customize file id generation.
My 'add_from' plugin:
Basically hijacks the current __add_one function to add this
functionality. But rather than monkey patching, the attached diff does
what I need.
I already have tests for it, since I'm using it in my add_from branch,
so I would be happy to update bzr.dev, with tests.
And the changes to the Action object, are only for sanitary purposes.
(you always implicitly return None, but since we now expect a result,
explicitly do so).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v184.108.40.206 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1023 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060719/edd7a1bf/attachment.bin
More information about the bazaar