non-HEAD branch access only works for newer versions of bzr

Bug #887785 reported by Eli Zaretskii
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Fix Released
Low
Jelmer Vernooij

Bug Description

In https://answers.launchpad.net/bzr-git/+question/171522 I was told back in September that it should be possible to track non-master branches with bzr-git trunk. But it seems this still doesn't work with today's trunk (revno 1460).

Here's what I did:

  bzr git-import git://git.savannah.gnu.org/gawk.git gawk-branches
  cd gawk-branches/gawk-4.0-stable
  bzr checkout

This created a working tree. A few hours later there was a commit to this branch, so I tried "bzr pull" in it, but bzr errored out:

  D:\gnu\bzr\gawk-branches\gawk-4.0-stable>bzr pull
  Using saved parent location: git://git.savannah.gnu.org/gawk.git,ref=refs%2Fheads%2Fgawk-4.0-stable
  bzr: ERROR: These branches have diverged. Use the missing command to see how.
  Use the merge command to reconcile them.

The backtrace from .bzr.log is below.

"bzr merge" did work. But since I made no changes in that branch, I expect "pull" to work.

Also, trying "bzr missing" says that this command isn't supported by the Git smart server protocol. Which is fine, but then why is that command suggested in the first place?

Here's the backtrace from the failed "bzr pull":

Tue 2011-11-08 22:32:48 +0200
0.156 bazaar version: 2.4.2
0.156 bzr arguments: [u'pull']
0.219 looking for plugins in C:/Documents and Settings/Zaretzky/Application Data/bazaar/2.0/plugins
0.219 looking for plugins in D:/usr/Bazaar/plugins
0.422 encoding stdout as sys.stdout encoding 'cp1252'
0.531 opening working tree 'D:/gnu/bzr/gawk-branches/gawk-4.0-stable'
3.281 Importing 0 new revisions
3.281 Packing repository GCRepositoryPackCollection(CHKInventoryRepository('file:///D:/gnu/bzr/gawk-branches/.bzr/repository/')), which has 1 pack files, containing 364 revisions with hint [].
3.516 Transferred: 3kB (4.0kB/s r:3kB w:0kB)
3.516 Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 946, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1150, in run_bzr
  File "bzrlib\commands.pyo", line 699, in run_argv_aliases
  File "bzrlib\commands.pyo", line 721, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 1076, in run
  File "bzrlib\decorators.pyo", line 217, in write_locked
  File "bzrlib\workingtree.pyo", line 1017, in pull
  File "bzrlib\branch.pyo", line 1109, in pull
  File "D:/usr/Bazaar/plugins\git\branch.py", line 834, in pull
  File "D:/usr/Bazaar/plugins\git\branch.py", line 770, in _basic_pull
  File "D:/usr/Bazaar/plugins\git\branch.py", line 750, in _update_revisions
  File "bzrlib\decorators.pyo", line 217, in write_locked
  File "bzrlib\branch.pyo", line 796, in generate_revision_history
DivergedBranches: These branches have diverged. Use the missing command to see how.
Use the merge command to reconcile them.

Related branches

Revision history for this message
Eli Zaretskii (eliz) wrote :

> "bzr merge" did work.

Actually, I take that back: it didn't work well. First, it produced text conflicts:

Text conflict in configure
Text conflict in configure.ac
Text conflict in doc/gawk.info
Text conflict in version.c
4 conflicts encountered.

And also it modified much more files than I expected. (I knew what to expect because I receive email notifications about commits to Gawk branches.)

I guess it simply tried to merge master onto gawk-4.0-stable. Even though it says

  Merging from remembered parent location git://git.savannah.gnu.org/gawk.git,ref=refs%2Fheads%2Fgawk-4.0-stable

which seems to be a lie.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Colocated branches are only suppored in bzr >= 2.5. You seem to be running 2.4.x.

Changed in bzr-git:
status: New → Invalid
status: Invalid → Triaged
importance: Undecided → Low
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Actually, bzr-git should probably warn if it won't be able to handle colocated branches.

Changed in bzr-git:
status: Triaged → Invalid
status: Invalid → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

It should warn now when you try to use it with bzr 2.4. Sorry, I should've mentioned this requirement when answering your question earlier.

Changed in bzr-git:
status: Triaged → Fix Committed
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 0.6.6
Revision history for this message
Eli Zaretskii (eliz) wrote :

I'm not sure why you talk about colocated branches. The branches created by git-import in this case are NOT colocated, each one is in a separate directory under a shared repo. This configuration is supported very well by bzr 2.4. So I'm not sure what exactly do I need bzr 2.5 for in this case. All I want is to have several branches in separate directories, and an ability to "bzr pull" in each one of the branches, to track more than just the master.

Revision history for this message
Eli Zaretskii (eliz) wrote :

In any case, I can confirm that pulling into individual branches works with bzr 2.5b2.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

They are colocated in git. In order to be able to address them in bzr, you need a bzr version with (API) support for colocated branches.

Jelmer Vernooij (jelmer)
summary: - Cannot "bzr pull" in a non-master branch created by git-import
+ non-HEAD branch access only works for newer versions fo bzr
summary: - non-HEAD branch access only works for newer versions fo bzr
+ non-HEAD branch access only works for newer versions of bzr
Jelmer Vernooij (jelmer)
Changed in bzr-git:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.