Rev 4543: (robertc) Fix bzr mv to not take out branch locks, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Jul 16 10:37:26 BST 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4543 [merge]
revision-id: pqm at pqm.ubuntu.com-20090716093725-tb2a3b4hin8uia6j
parent: pqm at pqm.ubuntu.com-20090716083950-cesfxhkt7rzszc8v
parent: robertc at robertcollins.net-20090716080003-bj11ua16u77xvsvx
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-07-16 10:37:25 +0100
message:
(robertc) Fix bzr mv to not take out branch locks,
fixing it when the branch is readonly. (Robert Collins, bug 216541)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_mv.py test_mv.py-20060705114902-33tkxz0o9cdshemo-1
=== modified file 'NEWS'
--- a/NEWS 2009-07-16 05:30:17 +0000
+++ b/NEWS 2009-07-16 08:00:03 +0000
@@ -30,6 +30,9 @@
commit that found a missing file will leave the tree unedited.
(Robert Collins, #282402)
+* ``bzr mv`` no longer takes out branch locks, which allows it to work
+ when the branch is readonly. (Robert Collins, #216541)
+
* Fixed spurious "Source branch does not support stacking" warning when
pushing. (Andrew Bennetts, #388908)
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2009-07-15 07:32:26 +0000
+++ b/bzrlib/builtins.py 2009-07-16 01:36:57 +0000
@@ -799,7 +799,7 @@
if len(names_list) < 2:
raise errors.BzrCommandError("missing file argument")
tree, rel_names = tree_files(names_list, canonicalize=False)
- tree.lock_write()
+ tree.lock_tree_write()
try:
self._run(tree, names_list, rel_names, after)
finally:
@@ -813,7 +813,7 @@
raise errors.BzrCommandError('--after cannot be specified with'
' --auto.')
work_tree, file_list = tree_files(names_list, default_branch='.')
- work_tree.lock_write()
+ work_tree.lock_tree_write()
try:
rename_map.RenameMap.guess_renames(work_tree, dry_run)
finally:
=== modified file 'bzrlib/tests/blackbox/test_mv.py'
--- a/bzrlib/tests/blackbox/test_mv.py 2009-04-01 20:30:51 +0000
+++ b/bzrlib/tests/blackbox/test_mv.py 2009-07-16 01:36:57 +0000
@@ -18,6 +18,7 @@
import os
+import bzrlib.branch
from bzrlib import (
osutils,
workingtree,
@@ -485,3 +486,13 @@
retcode=3)
self.assertEqual('bzr: ERROR: --after cannot be specified with'
' --auto.\n', err)
+
+ def test_mv_readonly_lightweight_checkout(self):
+ branch = self.make_branch('foo')
+ branch = bzrlib.branch.Branch.open('readonly+' + branch.base)
+ tree = branch.create_checkout('tree', lightweight=True)
+ self.build_tree(['tree/path'])
+ tree.add('path')
+ # If this fails, the tree is trying to acquire a branch lock, which it
+ # shouldn't.
+ self.run_bzr(['mv', 'tree/path', 'tree/path2'])
More information about the bazaar-commits
mailing list