bzr revert with lightweight http checkout fails

Bug #319374 reported by David Reitter
This bug report is a duplicate of:  Bug #498409: bzr revert takes a branch lock. Edit Remove
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned
Nominated for 1.6 by Ramana Kumar

Bug Description

"bzr revert" fails with a lightweight http checkout:

bzr revert
bzr: ERROR: Cannot lock LockDir(http://bazaar-vcs.org/bzr/bzr.dev/.bzr/branch/lock): Transport operation not possible: http does not support mkdir()

This happens with 1.11 and with the current bzr.dev tip.

The checkout was created with

 bzr checkout --lightweight http://bazaar-vcs.org/bzr/bzr.dev bzr.dev

and I've then applied a patch locally that I wanted to undo now.
The docs say that "revert" is to "Reverse all changes since the last commit". The "update" doc says:
" If you want to discard your local changes, you can just do a
   'bzr revert' instead of 'bzr commit' after the update."

so I don't see why this shouldn't work.

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

I can reproduce this. Here's the traceback from the log file:

4.160 Traceback (most recent call last):
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/andrew/code/bzr/bzrlib/builtins.py", line 3444, in run
    tree.lock_write()
  File "/home/andrew/code/bzr/bzrlib/workingtree_4.py", line 628, in lock_write
    self.branch.lock_write()
  File "/home/andrew/code/bzr/bzrlib/branch.py", line 1667, in lock_write
    token = self.control_files.lock_write(token=token)
  File "/home/andrew/code/bzr/bzrlib/lockable_files.py", line 259, in lock_write
    token_from_lock = self._lock.lock_write(token=token)
  File "/home/andrew/code/bzr/bzrlib/lockdir.py", line 576, in lock_write
    return self.wait_lock()
  File "/home/andrew/code/bzr/bzrlib/lockdir.py", line 500, in wait_lock
    return self.attempt_lock()
  File "/home/andrew/code/bzr/bzrlib/lockdir.py", line 461, in attempt_lock
    result = self._attempt_lock()
  File "/home/andrew/code/bzr/bzrlib/lockdir.py", line 226, in _attempt_lock
    raise LockFailed(self, e)
LockFailed: Cannot lock LockDir(http://bazaar-vcs.org/bzr/bzr.dev/.bzr/branch/lock): Transport operation not possible: http does not support mkdir()

I think bzr revert shouldn't be write-locking the branch, just the tree.

Changed in bzr:
importance: Undecided → High
milestone: none → 1.12rc1
status: New → Confirmed
Revision history for this message
Eduardo de Oliveira Padoan (eopadoan) wrote :

On bzr 1.12 and bzr.dev r4058 I get the error:
(~/dev/bzr/bzr) edcrypt@edcrypt-laptop$ bzr revert bzrlib/builtins.py
bzr: ERROR: Cannot lock LockDir(lp-45955728:///~bzr/bzr/trunk/.bzr/branchlock): Transport operation not possible: readonly transport
(~/dev/bzr/bzr) edcrypt@edcrypt-laptop$ bzr.dev revert bzrlib/builtins.py
bzr: ERROR: Cannot lock LockDir(lp-45955728:///~bzr/bzr/trunk/.bzr/branchlock): Transport operation not possible: readonly transport

Vincent Ladeuil (vila)
Changed in bzr:
milestone: 1.12rc1 → none
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Any idea as to when this will be fixed? Thanks.

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.