Rev 4679: Merge bzr.dev. in http://bazaar.launchpad.net/~lifeless/bzr/2.1b1-pack-on-the-fly

Robert Collins robertc at robertcollins.net
Fri Sep 4 01:50:05 BST 2009


At http://bazaar.launchpad.net/~lifeless/bzr/2.1b1-pack-on-the-fly

------------------------------------------------------------
revno: 4679 [merge]
revision-id: robertc at robertcollins.net-20090904004955-suhaz7r608i4j9gm
parent: john at arbash-meinel.com-20090903210422-wlorwru9hzyo97o0
parent: pqm at pqm.ubuntu.com-20090904002239-lnn3vwtab1tcbqfg
committer: Robert Collins <robertc at robertcollins.net>
branch nick: 2.1b1-pack-on-the-fly
timestamp: Fri 2009-09-04 10:49:55 +1000
message:
  Merge bzr.dev.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/mail_client.py          mail_client.py-20070809192806-vuxt3t19srtpjpdn-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
  bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
  bzrlib/tests/test_mail_client.py test_mail_client.py-20070809192806-vuxt3t19srtpjpdn-2
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
  bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
  bzrlib/tests/test_shelf.py     test_prepare_shelf.p-20081005181341-n74qe6gu1e65ad4v-2
  bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
  doc/developers/testing.txt     testing.txt-20080812140359-i70zzh6v2z7grqex-1
=== modified file 'NEWS'
--- a/NEWS	2009-09-03 21:04:22 +0000
+++ b/NEWS	2009-09-04 00:49:55 +0000
@@ -18,6 +18,14 @@
 Bug Fixes
 *********
 
+* Bazaar's native protocol code now correctly handles EINTR, which most
+  noticeably occurs if you break in to the debugger while connected to a
+  bzr+ssh server.  You can now can continue from the debugger (by typing
+  'c') and the process continues.  However, note that pressing C-\ in the
+  shell may still kill the SSH process, which is bug 162509, so you must
+  sent a signal to the bzr process specifically, for example by typing
+  ``kill -QUIT PID`` in another shell.  (Martin Pool, #341535)
+
 * ``bzr check`` in pack-0.92, 1.6 and 1.9 format repositories will no
   longer report incorrect errors about ``Missing inventory ('TREE_ROOT', ...)``
   (Robert Collins, #416732)
@@ -25,6 +33,16 @@
 * Don't restrict the command name used to run the test suite.
   (Vincent Ladeuil, #419950)
 
+* Fetches from 2a to 2a are now again requested in 'groupcompress' order.
+  Groups that are seen as 'underutilized' will be repacked on-the-fly.
+  This means that when the source is fully packed, there is minimal
+  overhead during the fetch, but if the source is poorly packed the result
+  is a fairly well packed repository (not as good as 'bzr pack' but
+  good-enough.) (Robert Collins, John Arbash Meinel, #402652)
+
+* Network streams now decode adjacent records of the same type into a
+  single stream, reducing layering churn. (Robert Collins)
+
 Improvements
 ************
 
@@ -55,12 +73,20 @@
   parameterisation, and is substantially faster. (Robert Collins)
 
 
-bzr 2.0rc2
-##########
+bzr 2.0rc2 (not released yet)
+#############################
 
 Bug Fixes
 *********
 
+* Bazaar's native protocol code now correctly handles EINTR, which most
+  noticeably occurs if you break in to the debugger while connected to a
+  bzr+ssh server.  You can now can continue from the debugger (by typing
+  'c') and the process continues.  However, note that pressing C-\ in the
+  shell may still kill the SSH process, which is bug 162509, so you must
+  sent a signal to the bzr process specifically, for example by typing
+  ``kill -QUIT PID`` in another shell.  (Martin Pool, #341535)
+
 * ``bzr check`` in pack-0.92, 1.6 and 1.9 format repositories will no
   longer report incorrect errors about ``Missing inventory ('TREE_ROOT', ...)``
   (Robert Collins, #416732)
@@ -69,15 +95,8 @@
   revisions that are in the fallback repository. (Regressed in 2.0rc1).
   (John Arbash Meinel, #419241)
 
-* Fetches from 2a to 2a are now again requested in 'groupcompress' order.
-  Groups that are seen as 'underutilized' will be repacked on-the-fly.
-  This means that when the source is fully packed, there is minimal
-  overhead during the fetch, but if the source is poorly packed the result
-  is a fairly well packed repository (not as good as 'bzr pack' but
-  good-enough.) (Robert Collins, John Arbash Meinel, #402652)
-
-* Fix a segmentation fault when computing the ``merge_sort`` of a graph
-  that has a ghost in the mainline ancestry.
+* Fix a potential segmentation fault when doing 'log' of a branch that had
+  ghosts in its mainline.  (Evaluating None as a tuple is bad.)
   (John Arbash Meinel, #419241)
 
 * ``groupcompress`` sort order is now more stable, rather than relying on

=== modified file 'bzrlib/mail_client.py'
--- a/bzrlib/mail_client.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/mail_client.py	2009-09-02 08:26:27 +0000
@@ -424,6 +424,10 @@
 
     _client_commands = ['emacsclient']
 
+    def __init__(self, config):
+        super(EmacsMail, self).__init__(config)
+        self.elisp_tmp_file = None
+
     def _prepare_send_function(self):
         """Write our wrapper function into a temporary file.
 
@@ -500,6 +504,7 @@
         if attach_path is not None:
             # Do not create a file if there is no attachment
             elisp = self._prepare_send_function()
+            self.elisp_tmp_file = elisp
             lmmform = '(load "%s")' % elisp
             mmform  = '(bzr-add-mime-att "%s")' % \
                 self._encode_path(attach_path, 'attachment')

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2009-09-03 15:26:27 +0000
+++ b/bzrlib/repository.py	2009-09-04 00:49:55 +0000
@@ -2329,7 +2329,7 @@
         num_file_ids = len(file_ids)
         for file_id, altered_versions in file_ids.iteritems():
             if pb is not None:
-                pb.update("fetch texts", count, num_file_ids)
+                pb.update("Fetch texts", count, num_file_ids)
             count += 1
             yield ("file", file_id, altered_versions)
 
@@ -3585,7 +3585,7 @@
                 self.target.texts.insert_record_stream(
                     self.source.texts.get_record_stream(
                         self.source.texts.keys(), 'topological', False))
-                pb.update('copying inventory', 0, 1)
+                pb.update('Copying inventory', 0, 1)
                 self.target.inventories.insert_record_stream(
                     self.source.inventories.get_record_stream(
                         self.source.inventories.keys(), 'topological', False))
@@ -4078,11 +4078,11 @@
                                                   self.source_repo.is_shared())
         converted.lock_write()
         try:
-            self.step('Copying content into repository.')
+            self.step('Copying content')
             self.source_repo.copy_content_into(converted)
         finally:
             converted.unlock()
-        self.step('Deleting old repository content.')
+        self.step('Deleting old repository content')
         self.repo_dir.transport.delete_tree('repository.backup')
         self.pb.note('repository converted')
 

=== modified file 'bzrlib/smart/medium.py'
--- a/bzrlib/smart/medium.py	2009-08-07 05:56:29 +0000
+++ b/bzrlib/smart/medium.py	2009-09-01 07:47:36 +0000
@@ -291,7 +291,7 @@
     def terminate_due_to_error(self):
         # TODO: This should log to a server log file, but no such thing
         # exists yet.  Andrew Bennetts 2006-09-29.
-        self.socket.close()
+        osutils.until_no_eintr(self.socket.close)
         self.finished = True
 
     def _write_out(self, bytes):
@@ -326,27 +326,27 @@
             bytes_to_read = protocol.next_read_size()
             if bytes_to_read == 0:
                 # Finished serving this request.
-                self._out.flush()
+                osutils.until_no_eintr(self._out.flush)
                 return
             bytes = self.read_bytes(bytes_to_read)
             if bytes == '':
                 # Connection has been closed.
                 self.finished = True
-                self._out.flush()
+                osutils.until_no_eintr(self._out.flush)
                 return
             protocol.accept_bytes(bytes)
 
     def _read_bytes(self, desired_count):
-        return self._in.read(desired_count)
+        return osutils.until_no_eintr(self._in.read, desired_count)
 
     def terminate_due_to_error(self):
         # TODO: This should log to a server log file, but no such thing
         # exists yet.  Andrew Bennetts 2006-09-29.
-        self._out.close()
+        osutils.until_no_eintr(self._out.close)
         self.finished = True
 
     def _write_out(self, bytes):
-        self._out.write(bytes)
+        osutils.until_no_eintr(self._out.write, bytes)
 
 
 class SmartClientMediumRequest(object):
@@ -712,16 +712,16 @@
 
     def _accept_bytes(self, bytes):
         """See SmartClientStreamMedium.accept_bytes."""
-        self._writeable_pipe.write(bytes)
+        osutils.until_no_eintr(self._writeable_pipe.write, bytes)
         self._report_activity(len(bytes), 'write')
 
     def _flush(self):
         """See SmartClientStreamMedium._flush()."""
-        self._writeable_pipe.flush()
+        osutils.until_no_eintr(self._writeable_pipe.flush)
 
     def _read_bytes(self, count):
         """See SmartClientStreamMedium._read_bytes."""
-        bytes = self._readable_pipe.read(count)
+        bytes = osutils.until_no_eintr(self._readable_pipe.read, count)
         self._report_activity(len(bytes), 'read')
         return bytes
 
@@ -765,15 +765,15 @@
     def _accept_bytes(self, bytes):
         """See SmartClientStreamMedium.accept_bytes."""
         self._ensure_connection()
-        self._write_to.write(bytes)
+        osutils.until_no_eintr(self._write_to.write, bytes)
         self._report_activity(len(bytes), 'write')
 
     def disconnect(self):
         """See SmartClientMedium.disconnect()."""
         if not self._connected:
             return
-        self._read_from.close()
-        self._write_to.close()
+        osutils.until_no_eintr(self._read_from.close)
+        osutils.until_no_eintr(self._write_to.close)
         self._ssh_connection.close()
         self._connected = False
 
@@ -802,7 +802,7 @@
         if not self._connected:
             raise errors.MediumNotConnected(self)
         bytes_to_read = min(count, _MAX_READ_SIZE)
-        bytes = self._read_from.read(bytes_to_read)
+        bytes = osutils.until_no_eintr(self._read_from.read, bytes_to_read)
         self._report_activity(len(bytes), 'read')
         return bytes
 
@@ -832,7 +832,7 @@
         """See SmartClientMedium.disconnect()."""
         if not self._connected:
             return
-        self._socket.close()
+        osutils.until_no_eintr(self._socket.close)
         self._socket = None
         self._connected = False
 

=== modified file 'bzrlib/smart/repository.py'
--- a/bzrlib/smart/repository.py	2009-09-02 22:29:55 +0000
+++ b/bzrlib/smart/repository.py	2009-09-03 00:33:35 +0000
@@ -522,6 +522,11 @@
 class _ByteStreamDecoder(object):
     """Helper for _byte_stream_to_stream.
 
+    The expected usage of this class is via the function _byte_stream_to_stream
+    which creates a _ByteStreamDecoder, pops off the stream format and then
+    yields the output of record_stream(), the main entry point to
+    _ByteStreamDecoder.
+
     Broadly this class has to unwrap two layers of iterators:
     (type, substream)
     (substream details)

=== modified file 'bzrlib/tests/test_mail_client.py'
--- a/bzrlib/tests/test_mail_client.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/tests/test_mail_client.py	2009-09-02 08:26:27 +0000
@@ -97,6 +97,8 @@
         # We won't be able to know the temporary file name at this stage
         # so we can't raise an assertion with assertEqual
         cmdline = eclient._get_compose_commandline(None, None, 'file%')
+        if eclient.elisp_tmp_file is not None:
+            self.addCleanup(osutils.delete_any, eclient.elisp_tmp_file)
         commandline = ' '.join(cmdline)
         self.assertContainsRe(commandline, '--eval')
         self.assertContainsRe(commandline, '(compose-mail nil nil)')
@@ -107,6 +109,8 @@
         eclient = mail_client.EmacsMail(None)
         commandline = eclient._get_compose_commandline(u'jrandom at example.org',
             u'Hi there!', u'file%')
+        if eclient.elisp_tmp_file is not None:
+            self.addCleanup(osutils.delete_any, eclient.elisp_tmp_file)
         for item in commandline:
             self.assertFalse(isinstance(item, unicode),
                 'Command-line item %r is unicode!' % item)

=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2009-09-01 21:21:53 +0000
+++ b/bzrlib/tests/test_repository.py	2009-09-04 00:49:55 +0000
@@ -681,7 +681,7 @@
         self.assertFalse(repo._format.supports_external_lookups)
 
 
-class Test2a(TestCaseWithTransport):
+class Test2a(tests.TestCaseWithMemoryTransport):
 
     def test_fetch_combines_groups(self):
         builder = self.make_branch_builder('source', format='2a')
@@ -710,8 +710,11 @@
         self.assertTrue(repo._format.pack_compresses)
 
     def test_inventories_use_chk_map_with_parent_base_dict(self):
-        tree = self.make_branch_and_tree('repo', format="2a")
+        tree = self.make_branch_and_memory_tree('repo', format="2a")
+        tree.lock_write()
+        tree.add([''], ['TREE_ROOT'])
         revid = tree.commit("foo")
+        tree.unlock()
         tree.lock_read()
         self.addCleanup(tree.unlock)
         inv = tree.branch.repository.get_inventory(revid)
@@ -726,12 +729,19 @@
         # at 20 unchanged commits, chk pages are packed that are split into
         # two groups such that the new pack being made doesn't have all its
         # pages in the source packs (though they are in the repository).
-        tree = self.make_branch_and_tree('tree', format='2a')
+        # Use a memory backed repository, we don't need to hit disk for this
+        tree = self.make_branch_and_memory_tree('tree', format='2a')
+        tree.lock_write()
+        self.addCleanup(tree.unlock)
+        tree.add([''], ['TREE_ROOT'])
         for pos in range(20):
             tree.commit(str(pos))
 
     def test_pack_with_hint(self):
-        tree = self.make_branch_and_tree('tree', format='2a')
+        tree = self.make_branch_and_memory_tree('tree', format='2a')
+        tree.lock_write()
+        self.addCleanup(tree.unlock)
+        tree.add([''], ['TREE_ROOT'])
         # 1 commit to leave untouched
         tree.commit('1')
         to_keep = tree.branch.repository._pack_collection.names()

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2009-08-26 23:25:28 +0000
+++ b/bzrlib/tests/test_selftest.py	2009-09-03 08:10:23 +0000
@@ -1493,6 +1493,7 @@
         outer_test = TestTestCase("outer_child")
         result = self.make_test_result()
         outer_test.run(result)
+        self.addCleanup(osutils.delete_any, outer_test._log_file_name)
         self.assertEqual(original_trace, bzrlib.trace._trace_file)
 
     def method_that_times_a_bit_twice(self):

=== modified file 'bzrlib/tests/test_shelf.py'
--- a/bzrlib/tests/test_shelf.py	2009-08-28 05:00:33 +0000
+++ b/bzrlib/tests/test_shelf.py	2009-09-03 17:04:21 +0000
@@ -503,6 +503,7 @@
             shelf_file.seek(0)
             unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
             unshelver.make_merger().do_merge()
+            self.addCleanup(unshelver.finalize)
             self.assertFileEqual('bar', 'tree/foo')
         finally:
             shelf_file.close()
@@ -526,6 +527,7 @@
         self.build_tree_contents([('tree/foo', 'z\na\nb\nc\n')])
         shelf_file.seek(0)
         unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
+        self.addCleanup(unshelver.finalize)
         unshelver.make_merger().do_merge()
         self.assertFileEqual('z\na\nb\nd\n', 'tree/foo')
 
@@ -554,6 +556,7 @@
         self.assertFileEqual('baz', 'tree/foo/bar')
         shelf_file.seek(0)
         unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
+        self.addCleanup(unshelver.finalize)
         unshelver.make_merger().do_merge()
         self.assertFalse('foo-id' in tree)
         self.assertFalse('bar-id' in tree)
@@ -699,6 +702,7 @@
         shelf_id = shelf_manager.shelve_changes(creator)
         self.failIfExists('tree/foo')
         unshelver = shelf_manager.get_unshelver(shelf_id)
+        self.addCleanup(unshelver.finalize)
         unshelver.make_merger().do_merge()
         self.assertFileEqual('bar', 'tree/foo')
 

=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py	2009-08-13 01:33:15 +0000
+++ b/bzrlib/tests/test_transform.py	2009-09-02 09:07:24 +0000
@@ -1916,6 +1916,7 @@
         branch.lock_write()
         self.addCleanup(branch.unlock)
         tt = TransformPreview(branch.basis_tree())
+        self.addCleanup(tt.finalize)
         tt.new_directory('', ROOT_PARENT, 'TREE_ROOT')
         rev = tt.commit(branch, 'my message')
         self.assertEqual([], branch.basis_tree().get_parent_ids())
@@ -1927,6 +1928,7 @@
         branch.lock_write()
         self.addCleanup(branch.unlock)
         tt = TransformPreview(branch.basis_tree())
+        self.addCleanup(tt.finalize)
         e = self.assertRaises(ValueError, tt.commit, branch,
                           'my message', ['rev1b-id'])
         self.assertEqual('Cannot supply merge parents for first commit.',
@@ -1957,6 +1959,7 @@
         tt.new_file('file', tt.root, 'contents', 'file-id')
         tt.commit(branch, 'message', strict=True)
         tt = TransformPreview(branch.basis_tree())
+        self.addCleanup(tt.finalize)
         trans_id = tt.trans_id_file_id('file-id')
         tt.delete_contents(trans_id)
         tt.create_file('contents', trans_id)

=== modified file 'doc/developers/testing.txt'
--- a/doc/developers/testing.txt	2009-03-03 01:45:32 +0000
+++ b/doc/developers/testing.txt	2009-09-02 23:45:04 +0000
@@ -34,10 +34,10 @@
 down the track do not break new features or bug fixes that you are
 contributing today.
 
-As of May 2008, Bazaar ships with a test suite containing over 12000 tests
-and growing. We are proud of it and want to remain so. As community
-members, we all benefit from it. Would you trust version control on
-your project to a product *without* a test suite like Bazaar has?
+As of September 2009, Bazaar ships with a test suite containing over
+23,000 tests and growing. We are proud of it and want to remain so. As
+community members, we all benefit from it. Would you trust version control
+on your project to a product *without* a test suite like Bazaar has?
 
 
 Running the Test Suite




More information about the bazaar-commits mailing list