On Thu, 2011-12-29 at 21:28 +0100, Johan Engelen wrote:
I strongly advise you to not work in branches and merge it into trunk, and stay away from any other so-called convenient advanced functionality of bzr, like push-pull-whatever. Simply use it in 'svn mode'. http://wiki.inkscape.org/wiki/index.php/Working_with_Bazaar#Using_a_centrali...
Glad things go solved, but just to provide some more information I thought I'd reply. In general, this is caused by a misunderstanding of what is happening, and it is really easy to fix.
I imagine this is the situation that people get in to:
$ bzr commit -m "Really cool work" $ bzr push lp:project Error: branches have diverged $ bzr merge lp:project $ bzr commit -m "Really cool work" $ bzr push lp:project
And generally, the developer is happy because the push worked. Their work is in the repo, but the history is now not as clear as it was previously (nothing is lost, just slightly hidden). A better way to handle this error is like this:
$ bzr commit -m "Really cool work" $ bzr push lp:project Error: branches have diverged $ bzr uncommit $ bzr shelve $ bzr pull lp:project $ bzr unshelve $ bzr commit -m "Really cool work" $ bzr push lp:project
This works really well if you have a single version that you've added. If you've added a whole set of revisions you probably want to set up a merge and do something like this.
$ bzr commit -m "Last commit of really cool work" $ bzr push lp:project Error: branches have diverged $ cd .... $ bzr branch lp:project tmp $ cd tmp $ bzr merge ../work $ bzr commit -m "Really cool work" $ cd ../work $ bzr pull ../tmp $ bzr push lp:project $ rm -rf ../tmp
You could push tmp as well, but I thought it'd be better to keep your working directory how it was.
HTH, Ted