Rev 4542: Resolve NEWS conflicts. in http://people.ubuntu.com/~robertc/baz2.0/integration

Robert Collins robertc at robertcollins.net
Fri Jul 17 00:20:27 BST 2009


At http://people.ubuntu.com/~robertc/baz2.0/integration

------------------------------------------------------------
revno: 4542 [merge]
revision-id: robertc at robertcollins.net-20090716232023-pyyca8djr07dge1v
parent: robertc at robertcollins.net-20090716231254-b2gcpjlce66cdr7b
parent: pqm at pqm.ubuntu.com-20090716093725-tb2a3b4hin8uia6j
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Fri 2009-07-17 09:20:23 +1000
message:
  Resolve NEWS conflicts.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/tests/blackbox/test_mv.py test_mv.py-20060705114902-33tkxz0o9cdshemo-1
  bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
  bzrlib/urlutils.py             urlutils.py-20060502195429-e8a161ecf8fac004
=== modified file 'NEWS'
--- a/NEWS	2009-07-16 00:52:51 +0000
+++ b/NEWS	2009-07-16 23:20:23 +0000
@@ -30,6 +30,12 @@
   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)
+  
 * Renames to lexographically lower basenames in trees that have never been
   committed to will no longer corrupt the dirstate. This was caused by an
   bug in the dirstate update_minimal method. (Robert Collins, #395556)

=== 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/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-07-01 10:49:05 +0000
+++ b/bzrlib/bzrdir.py	2009-07-16 04:56:26 +0000
@@ -3269,6 +3269,7 @@
         else:
             remote_repo = None
             policy = None
+        bzrdir._format.set_branch_format(self.get_branch_format())
         if require_stacking:
             # The repo has already been created, but we need to make sure that
             # we'll make a stackable branch.

=== 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'])

=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py	2009-06-17 03:53:51 +0000
+++ b/bzrlib/tests/test_remote.py	2009-07-16 05:22:50 +0000
@@ -341,6 +341,10 @@
             request_handlers.register(verb, orig_method)
         self.addCleanup(restoreVerb)
 
+    def assertFinished(self, fake_client):
+        """Assert that all of a FakeClient's expected calls have occurred."""
+        fake_client.finished_test()
+
 
 class Test_ClientMedium_remote_path_from_transport(tests.TestCase):
     """Tests for the behaviour of client_medium.remote_path_from_transport."""
@@ -446,7 +450,7 @@
         self.assertEqual(bzrdir.BzrDirMetaFormat1, type(result))
         self.assertEqual(expected._repository_format, result._repository_format)
         self.assertEqual(expected._branch_format, result._branch_format)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_current_server(self):
         transport = self.get_transport('.')
@@ -467,7 +471,7 @@
         self.assertEqual(bzrdir.BzrDirMetaFormat1, type(result))
         self.assertEqual(None, result._repository_format)
         self.assertEqual(None, result._branch_format)
-        client.finished_test()
+        self.assertFinished(client)
 
 
 class TestBzrDirOpenBranch(TestRemote):
@@ -506,7 +510,7 @@
         result = bzrdir.open_branch()
         self.assertIsInstance(result, RemoteBranch)
         self.assertEqual(bzrdir, result.bzrdir)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_branch_missing(self):
         transport = MemoryTransport()
@@ -559,7 +563,7 @@
         bzrdir = RemoteBzrDir(transport, remote.RemoteBzrDirFormat(),
             _client=client)
         result = bzrdir.open_branch()
-        client.finished_test()
+        self.assertFinished(client)
 
     def check_open_repository(self, rich_root, subtrees, external_lookup='no'):
         reference_format = self.get_repo_format()
@@ -779,7 +783,7 @@
         # transport connected to a real server.
         result = fmt._initialize_on_transport_ex_rpc(client, 'path',
             transport, False, False, False, None, None, None, None, False)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_error(self):
         """Error responses are translated, e.g. 'PermissionDenied' raises the
@@ -803,7 +807,7 @@
             False, False, False, None, None, None, None, False)
         self.assertEqual('path', err.path)
         self.assertEqual(': extra info', err.extra)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_error_from_real_server(self):
         """Integration test for error translation."""
@@ -884,7 +888,7 @@
         transport = transport.clone('quack')
         branch = self.make_remote_branch(transport, client)
         result = branch.get_parent()
-        client.finished_test()
+        self.assertFinished(client)
         self.assertEqual(None, result)
 
     def test_parent_relative(self):
@@ -916,7 +920,7 @@
         branch = self.make_remote_branch(transport, client)
         result = branch.get_parent()
         self.assertEqual('http://foo/', result)
-        client.finished_test()
+        self.assertFinished(client)
 
 
 class TestBranchSetParentLocation(RemoteBranchTestCase):
@@ -937,7 +941,7 @@
         branch._lock_token = 'b'
         branch._repo_lock_token = 'r'
         branch._set_parent_location(None)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_parent(self):
         transport = MemoryTransport()
@@ -954,7 +958,7 @@
         branch._lock_token = 'b'
         branch._repo_lock_token = 'r'
         branch._set_parent_location('foo')
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_backwards_compat(self):
         self.setup_smart_server_with_call_log()
@@ -992,7 +996,7 @@
         transport = transport.clone('quack')
         branch = self.make_remote_branch(transport, client)
         result = branch.tags.get_tag_dict()
-        client.finished_test()
+        self.assertFinished(client)
         self.assertEqual({}, result)
 
 
@@ -1012,7 +1016,7 @@
         transport = transport.clone('quack')
         branch = self.make_remote_branch(transport, client)
         result = branch.last_revision_info()
-        client.finished_test()
+        self.assertFinished(client)
         self.assertEqual((0, NULL_REVISION), result)
 
     def test_non_empty_branch(self):
@@ -1093,7 +1097,7 @@
         branch = bzrdir.open_branch()
         result = branch.get_stacked_on_url()
         self.assertEqual('../base', result)
-        client.finished_test()
+        self.assertFinished(client)
         # it's in the fallback list both for the RemoteRepository and its vfs
         # repository
         self.assertEqual(1, len(branch.repository._fallback_repositories))
@@ -1126,7 +1130,7 @@
         branch = bzrdir.open_branch()
         result = branch.get_stacked_on_url()
         self.assertEqual('../base', result)
-        client.finished_test()
+        self.assertFinished(client)
         # it's in the fallback list both for the RemoteRepository.
         self.assertEqual(1, len(branch.repository._fallback_repositories))
         # And we haven't had to construct a real repository.
@@ -1167,7 +1171,7 @@
         result = branch.set_revision_history([])
         branch.unlock()
         self.assertEqual(None, result)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_set_nonempty(self):
         # set_revision_history([rev-id1, ..., rev-idN]) is translated to calling
@@ -1205,7 +1209,7 @@
         result = branch.set_revision_history(['rev-id1', 'rev-id2'])
         branch.unlock()
         self.assertEqual(None, result)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_no_such_revision(self):
         transport = MemoryTransport()
@@ -1240,7 +1244,7 @@
         self.assertRaises(
             errors.NoSuchRevision, branch.set_revision_history, ['rev-id'])
         branch.unlock()
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_tip_change_rejected(self):
         """TipChangeRejected responses cause a TipChangeRejected exception to
@@ -1283,7 +1287,7 @@
         self.assertIsInstance(err.msg, unicode)
         self.assertEqual(rejection_msg_unicode, err.msg)
         branch.unlock()
-        client.finished_test()
+        self.assertFinished(client)
 
 
 class TestBranchSetLastRevisionInfo(RemoteBranchTestCase):
@@ -1399,7 +1403,7 @@
         self.assertEqual(
             [('set_last_revision_info', 1234, 'a-revision-id')],
             real_branch.calls)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_unexpected_error(self):
         # If the server sends an error the client doesn't understand, it gets
@@ -1513,7 +1517,7 @@
         config = branch._get_config()
         config.set_option('foo', 'bar')
         branch.unlock()
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_backwards_compat_set_option(self):
         self.setup_smart_server_with_call_log()
@@ -1543,7 +1547,7 @@
         transport = transport.clone('quack')
         branch = self.make_remote_branch(transport, client)
         self.assertRaises(errors.UnlockableTransport, branch.lock_write)
-        client.finished_test()
+        self.assertFinished(client)
 
 
 class TestBzrDirGetSetConfig(RemoteBzrDirTestCase):
@@ -2045,7 +2049,7 @@
             'success', ('ok', 'rev-five'))
         result = repo.get_rev_id_for_revno(5, (42, 'rev-foo'))
         self.assertEqual((True, 'rev-five'), result)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_history_incomplete(self):
         repo, client = self.setup_fake_client_and_repository('quack')
@@ -2054,7 +2058,7 @@
             'success', ('history-incomplete', 10, 'rev-ten'))
         result = repo.get_rev_id_for_revno(5, (42, 'rev-foo'))
         self.assertEqual((False, (10, 'rev-ten')), result)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_history_incomplete_with_fallback(self):
         """A 'history-incomplete' response causes the fallback repository to be
@@ -2080,7 +2084,7 @@
             'success', ('ok', 'rev-one'))
         result = repo.get_rev_id_for_revno(1, (42, 'rev-foo'))
         self.assertEqual((True, 'rev-one'), result)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_nosuchrevision(self):
         # 'nosuchrevision' is returned when the known-revid is not found in the
@@ -2092,7 +2096,7 @@
         self.assertRaises(
             errors.NoSuchRevision,
             repo.get_rev_id_for_revno, 5, (42, 'rev-foo'))
-        client.finished_test()
+        self.assertFinished(client)
 
 
 class TestRepositoryIsShared(TestRemoteRepository):
@@ -2231,7 +2235,7 @@
         resume_tokens, missing_keys = sink.insert_stream([], fmt, [])
         self.assertEqual([], resume_tokens)
         self.assertEqual(set(), missing_keys)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_locked_repo_with_no_lock_token(self):
         transport_path = 'quack'
@@ -2251,7 +2255,7 @@
         resume_tokens, missing_keys = sink.insert_stream([], fmt, [])
         self.assertEqual([], resume_tokens)
         self.assertEqual(set(), missing_keys)
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_locked_repo_with_lock_token(self):
         transport_path = 'quack'
@@ -2271,7 +2275,7 @@
         resume_tokens, missing_keys = sink.insert_stream([], fmt, [])
         self.assertEqual([], resume_tokens)
         self.assertEqual(set(), missing_keys)
-        client.finished_test()
+        self.assertFinished(client)
 
 
 class TestRepositoryTarball(TestRemoteRepository):
@@ -2362,7 +2366,7 @@
         client.add_expected_call(
             'PackRepository.autopack', ('quack/',), 'success', ('ok',))
         repo.autopack()
-        client.finished_test()
+        self.assertFinished(client)
 
     def test_ok_with_real_repo(self):
         """When the server returns 'ok' and there is a _real_repository, then

=== modified file 'bzrlib/urlutils.py'
--- a/bzrlib/urlutils.py	2009-04-24 05:08:51 +0000
+++ b/bzrlib/urlutils.py	2009-07-16 07:10:45 +0000
@@ -75,9 +75,9 @@
     This assumes that both paths are already fully specified file:// URLs.
     """
     if len(base) < MIN_ABS_FILEURL_LENGTH:
-        raise ValueError('Length of base must be equal or'
+        raise ValueError('Length of base (%r) must equal or'
             ' exceed the platform minimum url length (which is %d)' %
-            MIN_ABS_FILEURL_LENGTH)
+            (base, MIN_ABS_FILEURL_LENGTH))
     base = local_path_from_url(base)
     path = local_path_from_url(path)
     return escape(osutils.relpath(base, path))




More information about the bazaar-commits mailing list