programatically marking conflicts as resolved

Aaron Bentley at
Sun Nov 4 16:38:30 GMT 2007

Hash: SHA1

Sandy Dunlop wrote:
> Hi,
> If I have a WorkingTree object, and a file or list of files that I want
> to change from being conflicts to being resolved programatically in
> Python using bzrlib, what is the correct way to do this?

> I know there is a resolve method in Bazaar's, but I'm
> wondering what's the proper way to access this.

It depends on what you're trying to do.  To complete clear the conflicts
list, you can do:


If you want to do something more fine-grained, do you know the precise
conflicts, or only the file names?

If you only know the file names, you can indeed use
bzrlib.conflicts.resolve.  But be aware that this will clear all
conflicts associated with the file, which may or may not be what you
want.  If you only know the filename, this is still your best choice.

If you know exactly what conflict you want to remove, you should do
wt.get_conflicts(), remove its entry from the list, and then do

> I was expecting it to be a tree method

It's a smart function intended specifically for use with the
commandline.  Its behavior has nothing to do with trees' implementation,
and everything to do with commandline UIs.

Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the bazaar mailing list