Rev 4362: (robertc) Fix bug 376225 by having PAR discard ghosts. (Robert in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu May 14 11:40:42 BST 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4362
revision-id: pqm at pqm.ubuntu.com-20090514104039-kggemn7lrretzpvc
parent: pqm at pqm.ubuntu.com-20090514031159-va38ehp3ttmrf21l
parent: robertc at robertcollins.net-20090514094207-a0pqfjtw4oujd86m
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-05-14 11:40:39 +0100
message:
(robertc) Fix bug 376225 by having PAR discard ghosts. (Robert
Collins)
modified:
bzrlib/graph.py graph_walker.py-20070525030359-y852guab65d4wtn0-1
bzrlib/tests/per_repository/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
------------------------------------------------------------
revno: 4360.2.2
revision-id: robertc at robertcollins.net-20090514094207-a0pqfjtw4oujd86m
parent: robertc at robertcollins.net-20090514054614-om3zdqkpaxs52b0l
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repo-source
timestamp: Thu 2009-05-14 19:42:07 +1000
message:
Add bug info.
modified:
bzrlib/tests/per_repository/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
------------------------------------------------------------
revno: 4360.2.1
revision-id: robertc at robertcollins.net-20090514054614-om3zdqkpaxs52b0l
parent: pqm at pqm.ubuntu.com-20090513232416-vt21661225sx5v8m
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repo-source
timestamp: Thu 2009-05-14 15:46:14 +1000
message:
Don't return ghosts in the keyset for PendingAncestryResult.
modified:
bzrlib/graph.py graph_walker.py-20070525030359-y852guab65d4wtn0-1
bzrlib/tests/per_repository/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py 2009-04-04 02:50:01 +0000
+++ b/bzrlib/graph.py 2009-05-14 05:46:14 +0000
@@ -1556,7 +1556,7 @@
def _get_keys(self, graph):
NULL_REVISION = revision.NULL_REVISION
keys = [key for (key, parents) in graph.iter_ancestry(self.heads)
- if key != NULL_REVISION]
+ if key != NULL_REVISION and parents is not None]
return keys
def is_empty(self):
=== modified file 'bzrlib/tests/per_repository/test_fetch.py'
--- a/bzrlib/tests/per_repository/test_fetch.py 2009-05-07 05:08:46 +0000
+++ b/bzrlib/tests/per_repository/test_fetch.py 2009-05-14 09:42:07 +0000
@@ -20,6 +20,7 @@
bzrdir,
errors,
gpg,
+ graph,
remote,
repository,
)
@@ -298,3 +299,30 @@
revision_id = tree.commit('test')
repo.fetch(tree.branch.repository)
repo.fetch(tree.branch.repository)
+
+
+class TestSource(TestCaseWithRepository):
+ """Tests for/about the results of Repository._get_source."""
+
+ def test_no_absent_records_in_stream_with_ghosts(self):
+ # XXX: Arguably should be in interrepository_implementations but
+ # doesn't actually gain coverage there; need a specific set of
+ # permutations to cover it.
+ # bug lp:376255 was reported about this.
+ builder = self.make_branch_builder('repo')
+ builder.start_series()
+ builder.build_snapshot('tip', ['ghost'],
+ [('add', ('', 'ROOT_ID', 'directory', ''))],
+ allow_leftmost_as_ghost=True)
+ builder.finish_series()
+ b = builder.get_branch()
+ b.lock_read()
+ self.addCleanup(b.unlock)
+ repo = b.repository
+ source = repo._get_source(repo._format)
+ search = graph.PendingAncestryResult(['tip'], repo)
+ stream = source.get_stream(search)
+ for substream_type, substream in stream:
+ for record in substream:
+ self.assertNotEqual('absent', record.storage_kind,
+ "Absent record for %s" % (((substream_type,) + record.key),))
More information about the bazaar-commits
mailing list