Signature: update_workingtree(branch) The function works in a directory which contains a .bzr directory reflecting the last imported version, and with a working directory reflecting the desired status for the version that is being imported. The function should update the working tree with the corresponding adds and removals. For example, let's assume version foo_1.2-1 looked like this: . ./path/to/a/buggy1.c ./path/to/b/buggy2.c ./debian/rules ./debian/changelog ./debian/control ./debian/TODO And we get asked to import foo_1.2-2, which: (1) stops shipping buggy2.c (2) introduces modification in upstream file path/to/a/buggy3.c (3) drops debian/TODO (4) introduces debian/compat (5) modifies debian/changelog So, the tree update_workingtree() will see is: . ./path/to/a/buggy1.c ./path/to/a/buggy3.c ./debian/rules ./debian/changelog ./debian/control ./debian/compat And the actions it should perform: (1) delete path/to/b/buggy2.c _and_ path/to/b (2) add path/to/a/buggy3.c (3) delete debian/TODO (4) add debian/compat [action for (5) happens automatically] Note that for (2) and (4), a file-id has to be generated, _EXCEPT_: except if e.g. debian/compat existed in foo_0.9-5 already, was then dropped in foo_0.9-6, and is reappearing in 1.2-2: in that case, seems like we should preserve the original file-id... no? TODO: algorithm for deterministic file-ids