Rev 3384: (abentley, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Apr 28 04:29:20 BST 2008
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3384
revision-id:pqm at pqm.ubuntu.com-20080428032913-4fgik9du2kpxl8sf
parent: pqm at pqm.ubuntu.com-20080428012318-g5zq9wl2flua3r2s
parent: aaron at aaronbentley.com-20080428012745-n6x7a8cymzkswbtv
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2008-04-28 04:29:13 +0100
message:
(abentley,
robertc) Avoid pack name collisions when fetching all revisions
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/repository_implementations/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
------------------------------------------------------------
revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.17.1.77.1.3.1.20.1.38
revision-id:aaron at aaronbentley.com-20080428012745-n6x7a8cymzkswbtv
parent: aaron at aaronbentley.com-20080425221600-j1nkw6v8corwgw19
parent: pqm at pqm.ubuntu.com-20080428012318-g5zq9wl2flua3r2s
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: Aaron's mergeable stuff
timestamp: Sun 2008-04-27 21:27:45 -0400
message:
Merge with bzr.dev
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/fetch.py fetch.py-20050818234941-26fea6105696365d
bzrlib/repofmt/knitrepo.py knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/smart/repository.py repository.py-20061128022038-vr5wy5bubyb8xttk-1
bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
bzrlib/transport/ftp.py ftp.py-20051116161804-58dc9506548c2a53
------------------------------------------------------------
revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.17.1.77.1.3.1.20.1.37
revision-id:aaron at aaronbentley.com-20080425221600-j1nkw6v8corwgw19
parent: aaron at aaronbentley.com-20080425221234-ov2ahpio6y54mnlq
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: Aaron's mergeable stuff
timestamp: Fri 2008-04-25 18:16:00 -0400
message:
Remove workarounds for bug 212908
modified:
bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
------------------------------------------------------------
revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.17.1.77.1.3.1.20.1.36
revision-id:aaron at aaronbentley.com-20080425221234-ov2ahpio6y54mnlq
parent: aaron at aaronbentley.com-20080424214953-5ddh20nq0eipfxh1
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: Aaron's mergeable stuff
timestamp: Fri 2008-04-25 18:12:34 -0400
message:
Prevent fetch all from causing pack collisions
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/repository_implementations/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
=== modified file 'NEWS'
--- a/NEWS 2008-04-27 22:38:34 +0000
+++ b/NEWS 2008-04-28 01:27:45 +0000
@@ -32,6 +32,9 @@
* ``bzr commit`` now works with Microsoft's FTP service.
(Andreas Deininger)
+ * Fetching all revisions from a repository does not cause pack collisions.
+ (Robert Collins, Aaron Bentley, #212908)
+
* Set SO_REUSEADDR on server sockets of ``bzr serve`` to avoid problems
rebinding the socket when starting the server a second time.
(John Arbash Meinel, Martin Pool, #164288)
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2008-04-26 16:34:47 +0000
+++ b/bzrlib/repository.py 2008-04-28 01:27:45 +0000
@@ -2742,6 +2742,11 @@
# inventory parsing etc, IFF nothing to be copied is in the target.
# till then:
revision_ids = self.source.all_revision_ids()
+ revision_keys = [(revid,) for revid in revision_ids]
+ index = self.target._pack_collection.revision_index.combined_index
+ present_revision_ids = set(item[1][0] for item in
+ index.iter_entries(revision_keys))
+ revision_ids = set(revision_ids) - present_revision_ids
# implementing the TODO will involve:
# - detecting when all of a pack is selected
# - avoiding as much as possible pre-selection, so the
=== modified file 'bzrlib/tests/repository_implementations/test_fetch.py'
--- a/bzrlib/tests/repository_implementations/test_fetch.py 2008-04-10 06:08:55 +0000
+++ b/bzrlib/tests/repository_implementations/test_fetch.py 2008-04-25 22:12:34 +0000
@@ -141,3 +141,11 @@
# without causing any errors.
target_repo.fetch(source_repo, revision_id='rev1')
+ def test_fetch_all_same_revisions_twice(self):
+ # Blind-fetching all the same revisions twice should succeed and be a
+ # no-op the second time.
+ repo = self.make_repository('repo')
+ tree = self.make_branch_and_tree('tree')
+ revision_id = tree.commit('test')
+ repo.fetch(tree.branch.repository)
+ repo.fetch(tree.branch.repository)
=== modified file 'bzrlib/tests/test_reconfigure.py'
--- a/bzrlib/tests/test_reconfigure.py 2008-04-24 04:58:42 +0000
+++ b/bzrlib/tests/test_reconfigure.py 2008-04-25 22:16:00 +0000
@@ -201,10 +201,6 @@
parent = self.make_branch('parent')
checkout = parent.create_checkout('checkout')
checkout.commit('test', rev_id='new-commit', local=True)
-
- # work around fetch bug 212908
- checkout.commit('test2', local=True)
- checkout.branch.set_last_revision_info(1, 'new-commit')
reconfiguration = reconfigure.Reconfigure.to_lightweight_checkout(
checkout.bzrdir)
return checkout, parent, reconfiguration
@@ -229,9 +225,6 @@
child = parent.bzrdir.sprout('child').open_workingtree()
child.commit('test', rev_id='new-commit')
parent.pull(child.branch)
- # work around fetch bug 212908
- child.commit('test', rev_id='new-commit2')
- child.branch.set_last_revision_info(1, 'new-commit')
child.bzrdir.destroy_workingtree()
reconfiguration = reconfigure.Reconfigure.to_lightweight_checkout(
child.bzrdir)
More information about the bazaar-commits
mailing list