Problem diffing 2 branches

John Arbash Meinel john at
Mon Mar 26 20:54:10 BST 2007

Jean-François Veillette wrote:
> Here some additional contextual informations :
> - the first « root » branch (identified by
> /Developement/WebObjects/Wonder/Ajax/Ajax) is a fresh cvs checkout.
> - my current branch (identified by . ) is where I do my own modifications.
> In my current branch (.) I made a couple of changes, some of which I
> would like to push back to the original localtion in order to eventually
> commit to cvs.
> That pop-up a question ... I would like to cherry-pick my changes and
> only push some of them to the root branch, how can I do that ?

If they are both bzr branches (I assume they are), then you can use "bzr
merge -r X..Y" to select just some changes to merge. The syntax is
"FROM..TO", such that you are merging the changes between the revisions.

So if revision 9 is from the original CVS, and then 10 is a personal
patch, and then 11, 12, 13 are changes you want to merge back, I would do:

$ cvs update
$ bzr commit -m "Update from CVS"
# Always do the update and commit first, so that your changes don't get
# mixed with any CVS changes.
$ bzr merge -r 10..13 $PERSONALBRANCH
# Review the changes, fix any conflicts, etc
$ bzr commit -m "[cherrypick] changes for X, Y and Z"
$ cvs commit -m "changes for X, Y, and Z"

This is what I used to do when I was tracking an upstream CVS and my own
branch. But it requires having CVS commit rights. If you *don't*, then I
would suggest having 1 more branch, which is 'submit to upstream'.
Because the CVS branch should always track exactly what is in CVS, so
things don't get confused.

> Le 07-03-26 à 14:13, John Arbash Meinel a écrit :
>> Jean-François Veillette wrote:
>>> 13:53:32: bzr diff .  ~/Developement/WebObjects/Wonder/Ajax/Ajax/
>>> ... ... ...
>>> === modified file 'Components/AjaxAutoComplete.api'
>>> bzr: ERROR: [Errno 2] No such file or directory:
>>> '/Users/jfv/Developement/BiblioChamplain/Tamia2/DependancesExternes/Ajax/Components/AjaxAutoComplete.api'

^-- Hmm. Did if you do 'bzr status' in '.' does it give you "=== renamed
file .... => ...." ?

We could certainly have a limitation in the diff across branches code.
But if 'bzr diff -r -3' works in the directory you renamed the file, I
would expect the diff between branches to work.

>>> In the current branch, I have moved the Ajax/Components directory to a
>>> new location, so yes that file is not there anymore (and many other
>>> files as well).
>>> I would expect bzr to follow the moved file and diff accordingly.
>>> Thanks,
>>> - jfv
>> Did you tell 'bzr' that the file has moved with "bzr mv X Y", or did you
>> just do a filesystem move (mv X Y, or with Finder)?
> I moved using « bzr mv  ...»
>> I *am* surprised to see it give an Errno 2, and would have expected it
>> to just say that the file had been deleted, versus an unknown file
>> somewhere else. (diff wouldn't tell you unknowns, but status would).
>> I think it is a case of bzr trusting the working inventory, when things
>> could easily change without it knowing.
>> I'm pretty sure the new working tree code in 0.15 would handle this sort
>> of thing better.
>> Can you tell me what version of bzr you are using? (bzr --version)
> 14:15:59: bzr --version
> Bazaar (bzr) 0.14.0
> Using python interpreter: /usr/bin/python
> Using python standard library:
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4
> Using bzrlib:
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/bzrlib
> Copyright 2005, 2006, 2007 Canonical Ltd.
> bzr comes with ABSOLUTELY NO WARRANTY.  bzr is free software, and
> you may use, modify and redistribute it under the terms of the GNU
> General Public License version 2 or later.
> Thanks !
> - jfv


More information about the bazaar mailing list