Branching not (directly) possible from a colocated repository

Bug #768784 reported by Michael B. Trausch
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bzr-colo
Confirmed
High
Unassigned

Bug Description

When I attempt to branch a branch stored within a shared repository, I receive an error message that it is not a branch:

anise:desktop mbt$ bzr colo-fetch colo:bzr+ssh://aloe.trausch.us/home/mbt/Projects/desktop/alltray:origin/trunk alltray
Password:
bzr: ERROR: Not a branch: "/home/mbt/Projects/desktop/alltray/.bzr/branches/versions/0.7.5dev/".

But of course, that is a branch:

mbt@aloe ~/Projects/desktop/alltray/.bzr/branches/versions/0.7.5dev $ bzr info
Repository branch (format: 2a)
Location:
  shared repository: /home/mbt/Projects/desktop/alltray/.bzr/branches
  repository branch: .

Related branches:
  parent branch: /home/mbt/Projects/desktop/alltray/.bzr/branches/origin/trunk

Note that this is not the branch that I found this bug with, but it appears to be easily replicated for all branches.

I have received this error when attempting to use bzr 2.2.4 and bzr 2.3.0 with bzr-colo 0.2.1 and bzr-colo 0.3.0dev revision ID <email address hidden>, on multiple operating systems.

Revision history for this message
Neil Martinsen-Burrell (nmb) wrote :

It looks as if the colocated branch at aloe:/home/mbt/Projects/desktop/alltray may have lost touch with the branches that are stored in .bzr/branches. This can happen if colocated workspaces are moved in the filesystem, because bzr stores branche references as absolute paths. What is the output of "bzr info" and "bzr st" in /home/mbt/Projects/desktop/alltray? What is the output of "bzr colo-branches" in that same directory?

If this is in fact what happened, do "bzr colo-fixup" in /home/mbt/Projects/desktop/alltray.

Changed in bzr-colo:
status: New → Incomplete
Revision history for this message
Michael B. Trausch (mtrausch) wrote :

As I mentioned already, this happens with all branches.

These branches have never been relocated, and I use them daily on the workstation that they are on. The "bzr info" output for one of them is included in the original report, but here is both it and 'bzr st' as well as 'bzr cbs' (aliased to colo-branches) on the branch that fails to branch:

mbt@aloe ~/Projects/desktop/alltray $ bzr info
Lightweight checkout (format: 2a)
Location:
  light checkout root: .
   checkout of branch: .bzr/branches/versions/0.7.5dev
    shared repository: .bzr/branches

Related branches:
  parent branch: .bzr/branches/origin/trunk
mbt@aloe ~/Projects/desktop/alltray $ bzr st
modified:
  autogen.sh*
  config.guess*
  config.rpath*
  config.sub*
  debian/rules*
  intl/config.charset*
  utils/build-full-debug.sh*
  utils/build-release.sh*
  utils/clean-tree.sh*
  utils/latest-rev.py*
  utils/release-changelog.sh*
unknown:
  data/alltray.desktop.orig
  doc/close-to-tray.txt
  src/CloseToTray.vala
mbt@aloe ~/Projects/desktop/alltray $ bzr cbs
  origin/trunk
* versions/0.7.5dev

This branch is in perfect working order, hence the bug report...

Changed in bzr-colo:
status: Incomplete → New
summary: - Branching not possible from a colocated repository
+ Branching not (directly) possible from a colocated repository
Revision history for this message
Michael B. Trausch (mtrausch) wrote :
Download full text (4.5 KiB)

I have found a workaround: branching from the repository without the use of the colo extension for the source works just fine, for example the following sequence of commands works just fine (output omitted for clarity):

$ bzr colo-init alltray
$ cd alltray
$ bzr branch bzr+ssh://aloe.trausch.us/home/mbt/Projects/desktop/alltray/.bzr/branches/origin/trunk colo:origin/trunk

Also, the following single command works in the same way:

$ bzr colo-fetch bzr+ssh://aloe.trausch.us/home/mbt/Projects/desktop/alltray/.bzr/branches/origin/trunk alltray

The only problem comes when using the colo: specifier to branch from the source on the remote system, such as:

$ bzr colo-fetch colo:bzr+ssh://aloe.trausch.us/home/mbt/Projects/desktop/alltray:origin/trunk alltray

This is the output that is placed in ~/.bzr.log for the execution of the previous command:

Sat 2011-04-23 22:09:58 -0400
1.029 bazaar version: 2.3.0
1.029 bzr arguments: [u'colo-fetch', u'bzr+ssh://aloe.trausch.us/home/mbt/Projects/desktop/alltray:origin/trunk', u'alltray']
1.419 looking for plugins in /Users/mbt/.bazaar/plugins
1.439 looking for plugins in /Library/Python/2.6/site-packages/bzrlib/plugins
3.888 encoding stdout as sys.stdout encoding 'UTF-8'
4.196 creating repository in file:///Users/mbt/Projects/client/alltray/.bzr/branches/.bzr/.
4.206 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x1024bfc90> in file:///Users/mbt/Projects/client/alltray/.bzr/branches/origin/trunk/
4.270 creating branch reference in file:///Users/mbt/Projects/client/alltray/
4.329 trying to create missing lock '/Users/mbt/Projects/client/alltray/.bzr/checkout/dirstate'
4.329 opening working tree '/Users/mbt/Projects/client/alltray'
4.383 opening working tree '/Users/mbt/Projects/client/alltray'
5.074 ssh implementation is OpenSSH
10.866 bzr-svn: using Subversion 1.6.15 (), Subversion API 1.6.5 (), subvertpy 0.7.5
11.017 Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 923, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 1123, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/colo/commands.py", line 278, in run
    remember=True)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
 ...

Read more...

Revision history for this message
Michael B. Trausch (mtrausch) wrote :
Download full text (4.3 KiB)

Oops, I typo'd on the command. Here is the correct trace:

Sat 2011-04-23 22:12:50 -0400
0.145 bazaar version: 2.3.0
0.145 bzr arguments: [u'colo-fetch', u'colo:bzr+ssh://aloe.trausch.us/home/mbt/Projects/desktop/alltray:origin/trunk', u'alltray']
0.233 looking for plugins in /Users/mbt/.bazaar/plugins
0.233 looking for plugins in /Library/Python/2.6/site-packages/bzrlib/plugins
0.656 encoding stdout as sys.stdout encoding 'UTF-8'
0.760 creating repository in file:///Users/mbt/Projects/client/alltray/.bzr/branches/.bzr/.
0.770 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x1024e5c90> in file:///Users/mbt/Projects/client/alltray/.bzr/branches/origin/trunk/
0.852 creating branch reference in file:///Users/mbt/Projects/client/alltray/
0.865 trying to create missing lock '/Users/mbt/Projects/client/alltray/.bzr/checkout/dirstate'
0.865 opening working tree '/Users/mbt/Projects/client/alltray'
1.041 opening working tree '/Users/mbt/Projects/client/alltray'
1.469 bzr-svn: using Subversion 1.6.15 (), Subversion API 1.6.5 (), subvertpy 0.7.5
1.879 ssh implementation is OpenSSH
4.267 Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 923, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 1123, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/colo/commands.py", line 278, in run
    remember=True)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/builtins.py", line 964, in run
    possible_transports=possible_transports)
  File "/Library/Python/2.6/site-packages/bzrlib/bundle/__init__.py", line 39, in read_mergeable_from_url
    possible_transports=possible_transports)
  File "/Library/Python/2.6/site-packages/bzrlib/transport/__init__.py", line 1582, in get_transport
    base = directories.dereference(base)
  File "/Library/Python/2.6/site-packages/bzrlib/directory_service.py", line 58, in dereference
    return service().look_up(name, url)
  File "/Library/Python/2.6/site-packages/bzrlib/plugins/colo/colocated.py", line 142, in look_up
    return ColocatedWorkspace(url_piece).url_for_name(branch_name)
  File "/Library/Python/2.6/site-packages...

Read more...

Revision history for this message
Neil Martinsen-Burrell (nmb) wrote :

I can reproduce this:

$ ssh $remote_host
remote$ bzr colo-init blech
#make sure $HOME/blech doesn't exist on the local host
remote$ exit
$ bzr branch colo:bzr+ssh://$remote_host/Users/username/blech:trunk

gives

bzr: ERROR: Not a branch: "/Users/nmb/tmp/blech/.bzr/branches/trunk/".

Changed in bzr-colo:
status: New → Confirmed
importance: Undecided → High
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.