3

In my project , i have local branch for working and branch on network drive i did "bind branch" between local one and network one My idea is to use the bind option for auto backup of each local commit.

After i commit files in the local branch , i receive a message in network branch " Working tree is out of date, please run 'bzr update'."

my question is :

  1. Log on network branch will show the updated tree . Does the files are updated ? or i must do "update" ?
  2. automirror plugin will help me for this scenario?

thanks

Gil.I
  • 895
  • 12
  • 23

2 Answers2

4

Binding a local branch to a remote branch means that commits to the local branch will automatically push that commit to the remote branch. If the remote branch and the local branch are not in sync, the commit will fail and neither the local or remote branch will be affected and your changes will still be sitting in your working tree. To get your local branch in sync with the remote branch, use bzr update.

If your network branch has a working tree, then the working tree is not automatically updated when commits are pushed from the local branch into the network branch. The network branch's working tree has to be updated with bzr update or plugins like automirror or push-and-update.

Unless you actually need the working tree in the network branch, I would recommend that you reconfigure the branch to be tree-less using bzr reconfigure --branch. If you have a shared repository that the network branch belongs to, you will also need to use bzr reconfigure --with-no-trees on the repository to stop it creating trees on new branches.

dOxxx
  • 1,540
  • 1
  • 12
  • 28
  • thanks @dOxxx . if i DONT bind the branches and just do push after commmit i dont need to use the update command. that mean that auto push due to bind branches is not the same as manual push. am i right? do you have better suggestion on how to backup each user branch? thanks – Gil.I Oct 03 '11 at 07:23
  • i did unbind on my setup , and use automirror plugin so every local commit , post_commit hook is auto updating the network branch.thanks for the help. – Gil.I Oct 03 '11 at 09:06
  • That's interesting about `bzr push` updating the remote branch's working tree. I'm not 100% certain how the bound branch is actually implemented so it may be a remote commit and pull to the local branch instead of a local commit and then push. That may account for the difference in behaviour. – dOxxx Oct 03 '11 at 13:54
  • A commit on a bind branch does a `commit ` and then a `pull`. http://wiki.bazaar.canonical.com/CheckoutTutorial – TridenT Oct 04 '11 at 14:46
  • So I guess commits to a remote branch do not update the remote working tree but a push does? That seems kinda odd. – dOxxx Oct 04 '11 at 19:41
1

The 'bind branch' feature will succeed only if your local and network branches are up-to-date.

So the commit failed as there is a difference between these 2 working copies.

TridenT
  • 4,879
  • 1
  • 32
  • 56