Using Bazaar programatically
Gertjan Klein
gklein at xs4all.nl
Sat Feb 9 07:22:49 GMT 2008
James Westby wrote:
>My hunch is that if you supply the relative path of the files from the
>root of the branch to commit() then it will work.
Oddly, no. If I specify a relative path (i.e., r'test.txt'), I get a
traceback in smart_add, saying that "C:/Temp/test.txt" is not a child of
path "C:/dev/bzr/cache". This is true, obviously, but smart_add
apparently takes such paths to be relative to the current working
directory, not to the working tree directory. As smart_add is a method
of the working tree, which has an implied base directory, I am tempted
to think this is a bug. Would you agree?
The only way I found to make things work is to change the current
working directory to that of the working tree, and use relative paths,
but I am still hoping I don't have to do that. (I may end up with
multiple clients talking to my program, each running in a different
thread, and I'd hate it if one thread changes the directory another one
is still relying on.)
>You may like to look in to the tests in bzrlib/tests/ as they
>demonstrate the use of the API. Also, looking at some other plugins
>may help.
Thanks, I didn't think to look there. The number of test files is rather
daunting, but the commands subdirectory looks promising.
Regards,
Gertjan.
--
Gertjan Klein <gklein at xs4all.nl>
More information about the bazaar
mailing list