Rev 2672: Merge knits branch. in http://people.ubuntu.com/~robertc/baz2.0/repository
Robert Collins
robertc at robertcollins.net
Thu Jul 19 08:45:17 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/repository
------------------------------------------------------------
revno: 2672
revision-id: robertc at robertcollins.net-20070719074510-6atx30q1x6s75l1e
parent: robertc at robertcollins.net-20070719071921-2is4gdrs92rl1xft
parent: robertc at robertcollins.net-20070719063409-stu9sckrxp8wp3mo
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Thu 2007-07-19 17:45:10 +1000
message:
Merge knits branch.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repofmt/knitrepo.py knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/repository_implementations/test_reconcile.py test_reconcile.py-20060223022332-572ef70a3288e369
bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
------------------------------------------------------------
revno: 2592.1.25.2.7.1.1.3.1
revision-id: robertc at robertcollins.net-20070719063409-stu9sckrxp8wp3mo
parent: pqm at pqm.ubuntu.com-20070717180333-5smmeduk2q3sbzvw
committer: Robert Collins <robertc at robertcollins.net>
branch nick: knits
timestamp: Thu 2007-07-19 16:34:09 +1000
message:
LIBRARY API BREAKS:
* KnitIndex.get_parents now returns tuples. (Robert Collins)
INTERNALS:
* Unused functions on the private interface KnitIndex have been removed.
(Robert Collins)
* New ``knit.KnitGraphIndex`` which provides a ``KnitIndex`` layered on top
of a ``index.GraphIndex``. (Robert Collins)
* New ``knit.KnitVersionedFile.iter_parents`` method that allows querying
the parents of many knit nodes at once, reducing round trips to the
underlying index. (Robert Collins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/deprecated_graph.py graph.py-20050905070950-b47dce53236c5e48
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
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/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/interversionedfile_implementations/test_join.py test_join.py-20060302012326-9b5e9b0f0a03fedc
bzrlib/tests/repository_implementations/test_reconcile.py test_reconcile.py-20060223022332-572ef70a3288e369
bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_knit.py test_knit.py-20051212171302-95d4c00dd5f11f2b
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
=== modified file 'NEWS'
--- a/NEWS 2007-07-19 07:19:21 +0000
+++ b/NEWS 2007-07-19 07:45:10 +0000
@@ -41,6 +41,8 @@
comply with the style guide by being one or more sentences with an
initial capital and final period. (Martin Pool)
+ * KnitIndex.get_parents now returns tuples. (Robert Collins)
+
INTERNALS:
* merge now uses iter_changes to calculate changes, which makes room for
@@ -73,6 +75,16 @@
available in one step. This allows the write lock to remain while making
a series of data insertions. (e.g. data conversion). (Robert Collins)
+ * Unused functions on the private interface KnitIndex have been removed.
+ (Robert Collins)
+
+ * New ``knit.KnitGraphIndex`` which provides a ``KnitIndex`` layered on top
+ of a ``index.GraphIndex``. (Robert Collins)
+
+ * New ``knit.KnitVersionedFile.iter_parents`` method that allows querying
+ the parents of many knit nodes at once, reducing round trips to the
+ underlying index. (Robert Collins)
+
TESTING:
* Remove selftest ``--clean-output``, ``--numbered-dirs`` and
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2007-07-17 16:04:00 +0000
+++ b/bzrlib/remote.py 2007-07-19 07:45:10 +0000
@@ -302,7 +302,7 @@
lines = coded.split('\n')
revision_graph = {}
for line in lines:
- d = list(line.split())
+ d = tuple(line.split())
revision_graph[d[0]] = d[1:]
return revision_graph
=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py 2007-07-19 07:19:21 +0000
+++ b/bzrlib/repofmt/knitrepo.py 2007-07-19 07:45:10 +0000
@@ -158,7 +158,6 @@
a_weave = self._get_revision_vf()
if revision_id is None:
return a_weave.get_graph()
- entire_graph = a_weave.get_graph()
if revision_id not in a_weave:
raise errors.NoSuchRevision(self, revision_id)
else:
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2007-07-18 03:40:26 +0000
+++ b/bzrlib/repository.py 2007-07-19 07:45:10 +0000
@@ -767,7 +767,7 @@
a_weave = self.get_inventory_weave()
all_revisions = self._eliminate_revisions_not_present(
a_weave.versions())
- entire_graph = dict([(node, a_weave.get_parents(node)) for
+ entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for
node in all_revisions])
if revision_id is None:
return entire_graph
=== modified file 'bzrlib/tests/branch_implementations/test_branch.py'
--- a/bzrlib/tests/branch_implementations/test_branch.py 2007-07-17 16:04:00 +0000
+++ b/bzrlib/tests/branch_implementations/test_branch.py 2007-07-19 07:45:10 +0000
@@ -69,10 +69,10 @@
def test_create_tree_with_merge(self):
tree = self.create_tree_with_merge()
ancestry_graph = tree.branch.repository.get_revision_graph('rev-3')
- self.assertEqual({'rev-1':[],
- 'rev-2':['rev-1'],
- 'rev-1.1.1':['rev-1'],
- 'rev-3':['rev-2', 'rev-1.1.1'],
+ self.assertEqual({'rev-1':(),
+ 'rev-2':('rev-1', ),
+ 'rev-1.1.1':('rev-1', ),
+ 'rev-3':('rev-2', 'rev-1.1.1', ),
}, ancestry_graph)
def test_revision_ids_are_utf8(self):
=== modified file 'bzrlib/tests/repository_implementations/test_reconcile.py'
--- a/bzrlib/tests/repository_implementations/test_reconcile.py 2007-07-18 03:40:26 +0000
+++ b/bzrlib/tests/repository_implementations/test_reconcile.py 2007-07-19 07:45:10 +0000
@@ -337,7 +337,7 @@
d = bzrlib.bzrdir.BzrDir.open_from_transport(t)
repo = d.open_repository()
g = repo.get_revision_graph()
- if g['wrong-first-parent'] == ['1', '2']:
+ if tuple(g['wrong-first-parent']) == ('1', '2'):
raise TestSkipped('wrong-first-parent is not setup for testing')
self.checkUnreconciled(d, repo.reconcile())
# nothing should have been altered yet : inventories without
@@ -349,7 +349,7 @@
self.assertEqual(0, reconciler.garbage_inventories)
# and should have been fixed:
g = repo.get_revision_graph()
- self.assertEqual(['1', '2'], g['wrong-first-parent'])
+ self.assertEqual(('1', '2'), g['wrong-first-parent'])
def test_reconcile_wrong_order_secondary(self):
# a wrong order in secondary parents is ignored.
=== modified file 'bzrlib/tests/repository_implementations/test_repository.py'
--- a/bzrlib/tests/repository_implementations/test_repository.py 2007-07-18 04:31:29 +0000
+++ b/bzrlib/tests/repository_implementations/test_repository.py 2007-07-19 07:45:10 +0000
@@ -537,24 +537,24 @@
def test_get_revision_graph(self):
# we can get a mapping of id->parents for the entire revision graph or bits thereof.
- self.assertEqual({'rev1':[],
- 'rev2':['rev1'],
- 'rev3':['rev2'],
- 'rev4':['rev3'],
+ self.assertEqual({'rev1':(),
+ 'rev2':('rev1', ),
+ 'rev3':('rev2', ),
+ 'rev4':('rev3', ),
},
self.bzrdir.open_repository().get_revision_graph(None))
- self.assertEqual({'rev1':[]},
+ self.assertEqual({'rev1':()},
self.bzrdir.open_repository().get_revision_graph('rev1'))
- self.assertEqual({'rev1':[],
- 'rev2':['rev1']},
+ self.assertEqual({'rev1':(),
+ 'rev2':('rev1', )},
self.bzrdir.open_repository().get_revision_graph('rev2'))
self.assertRaises(errors.NoSuchRevision,
self.bzrdir.open_repository().get_revision_graph,
'orphan')
# and ghosts are not mentioned
- self.assertEqual({'rev1':[],
- 'rev2':['rev1'],
- 'rev3':['rev2'],
+ self.assertEqual({'rev1':(),
+ 'rev2':('rev1', ),
+ 'rev3':('rev2', ),
},
self.bzrdir.open_repository().get_revision_graph('rev3'))
# and we can ask for the NULLREVISION graph
=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py 2007-05-07 13:11:40 +0000
+++ b/bzrlib/tests/test_remote.py 2007-07-19 06:34:09 +0000
@@ -557,7 +557,7 @@
[('call_expecting_body', 'Repository.get_revision_graph',
('///sinhala/', ''))],
client._calls)
- self.assertEqual({r1: [], r2: [r1]}, result)
+ self.assertEqual({r1: (), r2: (r1, )}, result)
def test_specific_revision(self):
# with a specific revision we want the graph for that
@@ -577,7 +577,7 @@
[('call_expecting_body', 'Repository.get_revision_graph',
('///sinhala/', r2))],
client._calls)
- self.assertEqual({r11: [], r12: [], r2: [r11, r12], }, result)
+ self.assertEqual({r11: (), r12: (), r2: (r11, r12), }, result)
def test_no_such_revision(self):
revid = '123'
More information about the bazaar-commits
mailing list