Comment 7 for bug 71382

Revision history for this message
David Allouche (ddaa) wrote :

These questions would be best answered by the bzr community <http://bazaar-vcs.org/BzrSupport>. But here are some quick answers:

> So, what's the easiest way for me to extract a diff between a working branch and trunk?

One way to do it to use the "ancestor" revspec. That selects the latest common ancestor with another branch:

% bzr diff -r ancestor:../trunk

> Is it possible to perform a diff between a local branch and one distant?

Bug 6700 in bzr prevents "bzr diff" from working on a branch that does not have a working tree.

But this is probably not what you want to do here. New changes on the trunk that you have not merged yet would appear reversed in the diff.

> Or i have to checkout both branchs and perform a classical diff between the 2 directories?

It's better to use "bzr diff branch-A branch-B", as it will only consider versioned files and present renames properly (not as add+delete).

The technique I would use would be having a checkout of the trunk, and doing:

trunk % bzr merge ../my-branch
trunk % bzr diff > ../branch.patch
trunk % bzr revert

This has the advantage of producing a diff against the latest trunk, detecting new merge conflicts caused by recent changes on trunk, and preventing unmerged trunk changes from appearing reverted in the diff.

We also plan to add a code review feature to Launchpad in the next six months that would make it easy to produce such a diff: https://blueprints.launchpad.net/products/launchpad-bazaar/+spec/review-infrastructure