reconfigure --unstacked doesn't quite work for lp branches

Bug #551525 reported by Tim Penhey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Andrew Bennetts

Bug Description

I pushed up a test branch which is unrelated to trunk

$ bzr push
Using saved push location: lp:~thumper/wikkid/sandbox
Using default stacking branch /~wikkid/wikkid/trunk at lp-66503888:///~thumper/wikkid
Created new stacked branch referring to /~wikkid/wikkid/trunk.
HPSS calls: 21 (0 vfs) SmartSSHClientMedium(bzr+ssh://<email address hidden>/)

Now I tried to unstack it:

tim@elwood:~/src/wikkid/sandbox$ bzr reconfigure --unstacked lp:~thumper/wikkid/sandbox
bzr+ssh://bazaar.launchpad.net/~thumper/wikkid/sandbox/ is now not stacked

bzr: ERROR: Lock not held: RemoteRepository(bzr+ssh://bazaar.launchpad.net/~thumper/wikkid/sandbox/.bzr/)
HPSS calls: 22 (9 vfs) SmartSSHClientMedium(bzr+ssh://<email address hidden>/)
HPSS calls: 11 (6 vfs) SmartSSHClientMedium(bzr+ssh://<email address hidden>/)

It's straightforward to reproduce. The traceback in ~/.bzr.log looks like:

Traceback (most recent call last):
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 878, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 1082, in run_bzr
    ret = run(*run_argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 686, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 690, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/builtins.py", line 5462, in run
    reconfigure.ReconfigureUnstacked().apply(directory)
  File "/home/andrew/code/bzr/bzrlib/reconfigure.py", line 70, in apply
    branch.unlock()
  File "/home/andrew/code/bzr/bzrlib/decorators.py", line 222, in wrapped
    return unbound(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/remote.py", line 2476, in unlock
    self.repository.unlock()
  File "/home/andrew/code/bzr/bzrlib/decorators.py", line 222, in wrapped
    return unbound(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/remote.py", line 1119, in unlock
    return lock.cant_unlock_not_held(self)
  File "/home/andrew/code/bzr/bzrlib/lock.py", line 105, in cant_unlock_not_held
    raise errors.LockNotHeld(locked_object)
LockNotHeld: Lock not held: RemoteRepository(bzr+ssh://bazaar.launchpad.net/~spiv/wikkid/testonly/.bzr/)

Related branches

Martin Pool (mbp)
tags: added: hpss launchpad reconfigure stacking
Revision history for this message
Andrew Bennetts (spiv) wrote :

This seems likely to be a fairly shallow bug in Branch._unstack. At a glance the old_repository.unlock calls appear unbalanced.

Thanks for the report.

description: updated
Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Andrew Bennetts (spiv)
Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
Andrew Bennetts (spiv)
Changed in bzr:
milestone: none → 2.2.0
Revision history for this message
Andrew Bennetts (spiv) wrote :

Hah, actually it turned out to be that with RemoteBranches this method needs to replace self._real_branch.repository (if set) as well as self.repository. Proposing fix for review now.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Fixed in lp:bzr r5328

Changed in bzr:
milestone: 2.2.0 → 2.2b4
status: Confirmed → 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.