← Back to team overview

bzr-windows team mailing list archive

problem merging / rebasing with local sandbox - my workflow?

 

*## System ##

*Windows 7 Ultimate*
*bzr 2.3.1 w/ python 2.6
Installed to Program Files (x86) and also separately under cygwin; problem
occurs in both.

*
## Problem ##*

I have successfully branched off of SVN under a shared repo and pushed,
pulled & rebased in the past.

But, I wanted to set up a local sandbox this time instead. I have followed
the instructions from here:
http://doc.bazaar.canonical.com/latest/en/user-guide/organizing_your_workspace.html#local-sandbox

I am using the terminal / command line only for all commands.

So I have:

   - projects: shared bzr repo, --no-trees
      - trunk: branch of remote SVN trunk
      - featureX: branch of local trunk
      - featureY: branch of local trunk
      - sandbox: lightweight checkout of trunk, then switched to X or Y


The problem happens when:

   - I commit to X
   - someone else committed to trunk (or I did over on Y & pushed)
   - Try to push or pull X.

An alternate is:

   - I commit to X
   - I push X
   - I switch to Y
   - I commit to Y
   - I try to pull / merge / rebase Y so I can push

I get the message that the branches have diverged and I should use `missing`
to see them, or `merge` to resolve them. However, since these feature
branches are branches under a shared repo with no checkout, I get error
messages when I try to merge, pull or rebase.

It may be a problem with my workflow, or maybe I'm missing something, I'm
not sure.

*## Recreation ##*

Below are the steps that you can take to recreate this using BZR only,
taking SVN out of the picture. If the above tells you enough, you can ignore
this.

Here are the steps to recreate this with new test repositories:

# fake remote trunk
$ mkdir remote-trunk
$ bzr itit remote-trunk
> Created a standalone tree (format: 2a)

# new shared repo
$ mkdir shared
$ bzr init-repo shared --no-trees

# branch remote-trunk to shared/trunk
$ cd shared
$ bzr branch ../remote-trunk trunk
> Branched 0 revision(s).

# setup the feature branches
$ bzr branch trunk featureX
> Branched 0 revision(s).
$ bzr branch trunk featureY
> Branched 0 revision(s).

# setup the sandbox
$ bzr co --lightweight trunk sandbox
$ cd sandbox
$ bzr switch featureX
> Tree is up to date at revision 0.
> Switched to branch ~/shared/featureX

# add some files
$ touch x1
$ touch x2
$ bzr add .
> adding x1
> adding x2
$ bzr ci -m"adding dos xx - I like that beer"
> Committing to ~/shared/featureX
> added x1
> added x2
> Committed revision 1.

# switch and hack on Y
$ bzr switch ../featureY
> Udpated to revision 0.
> Switched to branch ~/shared/featureY
$ touch y1
$ touch y2
$ bzr add .
> adding y1
> adding y2
$ bzr ci -m"I need a wise saying here"
> Committing to ~/shared/featureY
> added y1
> added y2
> Committed revision 1.

# push X
$ cd ../featureX
$ bzr push ../../remote-trunk
> All changes applied successfully.
> Pushed up to revision 1.


# Now here is where it starts to be a problem.
# No matter what I do on Y, I get errors.

# First I pull trunk - OK
$ cd ../trunk
$ bzr pull
> Using saved parent location: ~/remote-trunk/
> Now on revision 1.

# Now I try to pull Y: - FAILS
$ cd ../featureY
$ bzr pull
> Using saved parent location ~/shared/trunk/
> bzr: ERROR: These branches have diverged. Use the missing command to see
how.
> Use the merge command to reconcile them.

# bzr missing shows what you'd expect; I have an extra revision on branch
nick featureY.
# it shows rev 1 on x & y and that they're different.
# but, the following commands issue errors:
$ bzr rebase
> bzr: ERROR: No Working Tree exists for ~/featureY/.bzr/checkout
$ bzr merge
> bzr: ERROR: No Working Tree exists for ~/featureY/.bzr/checkout

# trying both from the sandbox, while it's still pointing to featureY, still
errors
$ cd ../sandbox
$ bzr rebase
> Rebasing on file ~/shared/trunk/
> bzr: ERROR: Branches have no common ancestor, and no merge base revision
was specified.
$ bzr merge
> Merging from remembered parent location ~/shared/trunk/
> bzr: ERROR: Branches have no common ancestor, and no merge base revision
was specified

*## Conclusion ##*

So here, I'm lost. The only way I've found to work around it is to uncommit,
shelve, pull,
then unshelve, but it feels like I'm setting myself up for failure there.

Any suggestions or ideas would be greatly appreciated.

Follow ups