Merge lp:~lifeless/bzr/bug-423818 into lp:bzr/2.0

Proposed by Robert Collins
Status: Merged
Approved by: Martin Pool
Approved revision: 4656
Merge reported by: Robert Collins
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr/bug-423818
Merge into: lp:bzr/2.0
Diff against target: None lines
To merge this branch: bzr merge lp:~lifeless/bzr/bug-423818
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+11279@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Oh hai. bug fixes.

Revision history for this message
Martin Pool (mbp) :
review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

> Oh hai. bug fixes.

do you want me to land this, or ..?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-09-04 07:47:47 +0000
+++ NEWS 2009-09-06 20:34:43 +0000
@@ -31,6 +31,14 @@
31* Clearer message when Bazaar runs out of memory, instead of a ``MemoryError``31* Clearer message when Bazaar runs out of memory, instead of a ``MemoryError``
32 traceback. (Martin Pool, #109115)32 traceback. (Martin Pool, #109115)
3333
34* Conversion to 2a will create a single pack for all the new revisions (as
35 long as it ran without interruption). This improves both ``bzr upgrade``
36 and ``bzr pull`` or ``bzr merge`` from local branches in older formats.
37 The autopack logic that occurs every 100 revisions during local
38 conversions was not returning that pack's identifier, which resulted in
39 the partial packs created during the conversion not being consolidated
40 at the end of the conversion process. (Robert Collins, #423818)
41
34* Fetches from 2a to 2a are now again requested in 'groupcompress' order.42* Fetches from 2a to 2a are now again requested in 'groupcompress' order.
35 Groups that are seen as 'underutilized' will be repacked on-the-fly.43 Groups that are seen as 'underutilized' will be repacked on-the-fly.
36 This means that when the source is fully packed, there is minimal44 This means that when the source is fully packed, there is minimal
3745
=== modified file 'bzrlib/repofmt/groupcompress_repo.py'
--- bzrlib/repofmt/groupcompress_repo.py 2009-09-04 03:58:41 +0000
+++ bzrlib/repofmt/groupcompress_repo.py 2009-09-06 20:34:43 +0000
@@ -617,10 +617,11 @@
617 self._remove_pack_from_memory(pack)617 self._remove_pack_from_memory(pack)
618 # record the newly available packs and stop advertising the old618 # record the newly available packs and stop advertising the old
619 # packs619 # packs
620 self._save_pack_names(clear_obsolete_packs=True)620 result = self._save_pack_names(clear_obsolete_packs=True)
621 # Move the old packs out of the way now they are no longer referenced.621 # Move the old packs out of the way now they are no longer referenced.
622 for revision_count, packs in pack_operations:622 for revision_count, packs in pack_operations:
623 self._obsolete_packs(packs)623 self._obsolete_packs(packs)
624 return result
624625
625626
626class CHKInventoryRepository(KnitPackRepository):627class CHKInventoryRepository(KnitPackRepository):
627628
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- bzrlib/repofmt/pack_repo.py 2009-08-14 11:11:29 +0000
+++ bzrlib/repofmt/pack_repo.py 2009-09-06 20:34:43 +0000
@@ -2078,13 +2078,13 @@
2078 "Repository %s has missing compression parent(s) %r "2078 "Repository %s has missing compression parent(s) %r "
2079 % (self.repo, sorted(all_missing)))2079 % (self.repo, sorted(all_missing)))
2080 self._remove_pack_indices(self._new_pack)2080 self._remove_pack_indices(self._new_pack)
2081 should_autopack = False2081 any_new_content = False
2082 if self._new_pack.data_inserted():2082 if self._new_pack.data_inserted():
2083 # get all the data to disk and read to use2083 # get all the data to disk and read to use
2084 self._new_pack.finish()2084 self._new_pack.finish()
2085 self.allocate(self._new_pack)2085 self.allocate(self._new_pack)
2086 self._new_pack = None2086 self._new_pack = None
2087 should_autopack = True2087 any_new_content = True
2088 else:2088 else:
2089 self._new_pack.abort()2089 self._new_pack.abort()
2090 self._new_pack = None2090 self._new_pack = None
@@ -2095,13 +2095,15 @@
2095 self._remove_pack_from_memory(resumed_pack)2095 self._remove_pack_from_memory(resumed_pack)
2096 resumed_pack.finish()2096 resumed_pack.finish()
2097 self.allocate(resumed_pack)2097 self.allocate(resumed_pack)
2098 should_autopack = True2098 any_new_content = True
2099 del self._resumed_packs[:]2099 del self._resumed_packs[:]
2100 if should_autopack:2100 if any_new_content:
2101 if not self.autopack():2101 result = self.autopack()
2102 if not result:
2102 # when autopack takes no steps, the names list is still2103 # when autopack takes no steps, the names list is still
2103 # unsaved.2104 # unsaved.
2104 return self._save_pack_names()2105 return self._save_pack_names()
2106 return result
2105 return []2107 return []
21062108
2107 def _suspend_write_group(self):2109 def _suspend_write_group(self):
21082110
=== modified file 'bzrlib/tests/per_pack_repository.py'
--- bzrlib/tests/per_pack_repository.py 2009-08-14 00:55:42 +0000
+++ bzrlib/tests/per_pack_repository.py 2009-09-06 20:34:43 +0000
@@ -239,31 +239,38 @@
239 self.assertTrue(large_pack_name in pack_names)239 self.assertTrue(large_pack_name in pack_names)
240240
241 def test_commit_write_group_returns_new_pack_names(self):241 def test_commit_write_group_returns_new_pack_names(self):
242 # This test doesn't need real disk.
243 self.vfs_transport_factory = tests.MemoryServer
242 format = self.get_format()244 format = self.get_format()
243 tree = self.make_branch_and_tree('foo', format=format)245 repo = self.make_repository('foo', format=format)
244 tree.commit('first post')
245 repo = tree.branch.repository
246 repo.lock_write()246 repo.lock_write()
247 try:247 try:
248 repo.start_write_group()248 # All current pack repository styles autopack at 10 revisions; and
249 try:249 # autopack as well as regular commit write group needs to return
250 inv = inventory.Inventory(revision_id="A")250 # the new pack name. Looping is a little ugly, but we don't have a
251 inv.root.revision = "A"251 # clean way to test both the autopack logic and the normal code
252 repo.texts.add_lines((inv.root.file_id, "A"), [], [])252 # path without doing this loop.
253 rev = _mod_revision.Revision(timestamp=0, timezone=None,253 for pos in range(10):
254 committer="Foo Bar <foo@example.com>", message="Message",254 revid = str(pos)
255 revision_id="A")255 repo.start_write_group()
256 rev.parent_ids = ()256 try:
257 repo.add_revision("A", rev, inv=inv)257 inv = inventory.Inventory(revision_id=revid)
258 except:258 inv.root.revision = revid
259 repo.abort_write_group()259 repo.texts.add_lines((inv.root.file_id, revid), [], [])
260 raise260 rev = _mod_revision.Revision(timestamp=0, timezone=None,
261 else:261 committer="Foo Bar <foo@example.com>", message="Message",
262 old_names = repo._pack_collection._names.keys()262 revision_id=revid)
263 result = repo.commit_write_group()263 rev.parent_ids = ()
264 cur_names = repo._pack_collection._names.keys()264 repo.add_revision(revid, rev, inv=inv)
265 new_names = list(set(cur_names) - set(old_names))265 except:
266 self.assertEqual(new_names, result)266 repo.abort_write_group()
267 raise
268 else:
269 old_names = repo._pack_collection._names.keys()
270 result = repo.commit_write_group()
271 cur_names = repo._pack_collection._names.keys()
272 new_names = list(set(cur_names) - set(old_names))
273 self.assertEqual(new_names, result)
267 finally:274 finally:
268 repo.unlock()275 repo.unlock()
269276

Subscribers

People subscribed via source and target branches