Using Bazaar programatically

Gertjan Klein gklein at xs4all.nl
Thu Feb 14 11:19:40 GMT 2008


Gertjan Klein wrote:

OK, I got a little further.

>Robert Collins wrote:
>
>>On Sat, 2008-02-09 at 08:22 +0100, Gertjan Klein wrote:
>>> 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?
>>
>>It is; it only recently got migrated there and obviously we have not
>>done as good a job of the migration as might be desired :).
>
>Thanks for confirming that. Would it make sense for me to use the
>development version of bazaar (assuming this bug will get fixed)?

I would still like to know this...

>I have found other puzzling behaviour. Using almost the same test
>program as I posted before (pasted below), I found that I can
>programatically add files to a maximum of one subdirectory deep only (so
>my response to James Westby was spoken too soon).

This one I have solved (by littering the Bazaar source with print
statements). It turned out that the Bazaar WorkingTree commit method
expects the list of files to be "normalized"; on Windows, this means
that the standard backslashes need to be converted to forward slashes. I
have done this using:

from bzrlib.osutils import normpath
[...]
filelist = [normpath(name) for name in filelist]

It would be good if this was documented! Speaking of documentation: the
WorkingTree API docs here:

http://starship.python.net/crew/mwh/bzrlibapi/bzrlib.workingtree.WorkingTree.html

list the commit method as undocumented. Perhaps a reference to the
Commit class's commit method can be added, as that seems to be what gets
called? 

Regards,
Gertjan.

-- 
Gertjan Klein <gklein at xs4all.nl>




More information about the bazaar mailing list