Rev 2861: Progress bar take two. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Mon Oct 29 16:54:14 GMT 2007


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

------------------------------------------------------------
revno: 2861
revision-id:robertc at robertcollins.net-20071029165400-vewpp1vwd60ycibq
parent: robertc at robertcollins.net-20071029034721-cdbsecglq7q5qsvz
parent: robertc at robertcollins.net-20071029133535-yjj4ykvsr6ueqrvt
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Tue 2007-10-30 03:54:00 +1100
message:
  Progress bar take two.
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.46.1.18.1.1.2.21.2.10.3.8.2.9.1.9.1.6
    revision-id:robertc at robertcollins.net-20071029133535-yjj4ykvsr6ueqrvt
    parent: robertc at robertcollins.net-20071029133250-giuy5zsjtycly6wz
    parent: pqm at pqm.ubuntu.com-20071029050400-j2jmz8smj2yecfrr
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: pack-progress
    timestamp: Tue 2007-10-30 00:35:35 +1100
    message:
      Merge bzr.dev.
        ------------------------------------------------------------
        revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.46.1.18.1.1.2.21.2.10.3.8.2.9.1.9.2.1
        revision-id:pqm at pqm.ubuntu.com-20071029050400-j2jmz8smj2yecfrr
        parent: pqm at pqm.ubuntu.com-20071028093324-h4ymz42l31vwfbu1
        parent: robertc at robertcollins.net-20071029040019-3x9as04a7s29motr
        committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
        branch nick: +trunk
        timestamp: Mon 2007-10-29 05:04:00 +0000
        message:
          (robertc) Fix pack-repository to support get_parents calls as the first call on a repository, and fix full-branch push/pull performance to not suck terribly. (Robert Collins)
        modified:
          bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
          bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.46.1.18.1.1.2.21.2.10.3.8.2.9.1.9.1.5
    revision-id:robertc at robertcollins.net-20071029133250-giuy5zsjtycly6wz
    parent: robertc at robertcollins.net-20071029040513-b1f6b3xkhslgkt2s
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: pack-progress
    timestamp: Tue 2007-10-30 00:32:50 +1100
    message:
      Signatures need a progress bar too.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.46.1.18.1.1.2.21.2.10.3.8.2.9.1.9.1.4
    revision-id:robertc at robertcollins.net-20071029040513-b1f6b3xkhslgkt2s
    parent: robertc at robertcollins.net-20071029040019-3x9as04a7s29motr
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: pack-progress
    timestamp: Mon 2007-10-29 15:05:13 +1100
    message:
      * A progress bar has been added for knitpack -> knitpack fetching.
        (Robert Collins, #157789)
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/progress.py             progress.py-20050610070202-df9faaab791964c0
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.46.1.18.1.1.2.21.2.10.3.8.2.9.1.9.1.3
    revision-id:robertc at robertcollins.net-20071029040019-3x9as04a7s29motr
    parent: robertc at robertcollins.net-20071028234731-17kxx1yqlzuw1rof
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: pack
    timestamp: Mon 2007-10-29 15:00:19 +1100
    message:
      Unbreak autopack. Doh.
    modified:
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
    ------------------------------------------------------------
    revno: 2592.1.25.2.7.1.28.1.6.1.3.1.9.2.1.3.74.1.31.3.18.1.9.1.2.1.12.1.8.1.46.1.18.1.1.2.21.2.10.3.8.2.9.1.9.1.2
    revision-id:robertc at robertcollins.net-20071028234731-17kxx1yqlzuw1rof
    parent: robertc at robertcollins.net-20071028190205-j7669ntq0jj7s5fl
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: pack
    timestamp: Mon 2007-10-29 10:47:31 +1100
    message:
      Make the docstring for _find_file_ids_from_xml_inventory_lines explicit about the use filter_ids is put to.
    modified:
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-10-29 03:47:21 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-10-29 16:54:00 +0000
@@ -617,9 +617,12 @@
         if self._new_pack is not None:
             raise errors.BzrError('call to create_pack_from_packs while '
                 'another pack is being written.')
-        if revision_ids is not None and len(revision_ids) == 0:
-            # silly fetch request.
-            return None
+        if revision_ids is not None:
+            if len(revision_ids) == 0:
+                # silly fetch request.
+                return None
+            else:
+                revision_ids = frozenset(revision_ids)
         pb = ui.ui_factory.nested_progress_bar()
         try:
             return self._create_pack_from_packs(packs, suffix, revision_ids,
@@ -629,7 +632,6 @@
 
     def _create_pack_from_packs(self, packs, suffix, revision_ids, pb):
         pb.update("Opening pack", 0, 5)
-        revision_ids = frozenset(revision_ids)
         new_pack = NewPack(self._upload_transport, self._index_transport,
             self._pack_transport, upload_suffix=suffix)
         # buffer data - we won't be reading-back during the pack creation and
@@ -840,6 +842,17 @@
         return pack_operations
 
     def _copy_nodes(self, nodes, index_map, writer, write_index):
+        """Copy knit nodes between packs with no graph references."""
+        pb = ui.ui_factory.nested_progress_bar()
+        try:
+            return self._do_copy_nodes(nodes, index_map, writer,
+                write_index, pb)
+        finally:
+            pb.finished()
+
+    def _do_copy_nodes(self, nodes, index_map, writer, write_index, pb):
+        # for record verification
+        knit_data = _KnitData(None)
         # plan a readv on each source pack:
         # group by pack
         nodes = sorted(nodes)
@@ -852,6 +865,8 @@
             if index not in request_groups:
                 request_groups[index] = []
             request_groups[index].append((key, value))
+        record_index = 0
+        pb.update("Copied record", record_index, len(nodes))
         for index, items in request_groups.iteritems():
             pack_readv_requests = []
             for key, value in items:
@@ -868,8 +883,13 @@
             for (names, read_func), (_1, _2, (key, eol_flag)) in \
                 izip(reader.iter_records(), pack_readv_requests):
                 raw_data = read_func(None)
+                # check the header only
+                df, _ = knit_data._parse_record_header(key[-1], raw_data)
+                df.close()
                 pos, size = writer.add_bytes_record(raw_data, names)
                 write_index.add_node(key, eol_flag + "%d %d" % (pos, size))
+                pb.update("Copied record", record_index)
+                record_index += 1
 
     def _copy_nodes_graph(self, nodes, index_map, writer, write_index,
         output_lines=False):

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-10-26 08:56:09 +0000
+++ b/bzrlib/repository.py	2007-10-28 23:47:31 +0000
@@ -1058,7 +1058,10 @@
         This performs the translation of xml lines to revision ids.
 
         :param line_iterator: An iterator of lines
-        :param revision_ids: The revision ids to filter for.
+        :param revision_ids: The revision ids to filter for. This should be a
+            set or other type which supports efficient __contains__ lookups, as
+            the revision id from each parsed line will be looked up in the
+            revision_ids filter.
         :return: a dictionary mapping altered file-ids to an iterable of
         revision_ids. Each altered file-ids has the exact revision_ids that
         altered it listed explicitly.



More information about the bazaar-commits mailing list