Merge lp:~wgrant/bzr-git/dulwich-0.9.6 into lp:bzr-git

Proposed by William Grant on 2015-05-10
Status: Merged
Merged at revision: 1630
Proposed branch: lp:~wgrant/bzr-git/dulwich-0.9.6
Merge into: lp:bzr-git
Diff against target: 162 lines (+43/-11)
6 files modified
NEWS (+2/-0)
fetch.py (+4/-2)
info.py (+1/-1)
tests/test_fetch.py (+1/-1)
tests/test_transportgit.py (+19/-1)
transportgit.py (+16/-6)
To merge this branch: bzr merge lp:~wgrant/bzr-git/dulwich-0.9.6
Reviewer Review Type Date Requested Status
Richard Wilbur 2015-05-10 Approve on 2015-05-10
Review via email: mp+258714@code.launchpad.net
To post a comment you must log in.
lp:~wgrant/bzr-git/dulwich-0.9.6 updated on 2015-05-10
1635. By William Grant on 2015-05-10

Fix test_tagged_tree to not create a non-integral tag timestamp.

Richard Wilbur (richard-wilbur) wrote :

Thanks, William, for updating bzr-git.
+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2013-09-22 21:28:04 +0000
3+++ NEWS 2015-05-10 00:53:31 +0000
4@@ -5,6 +5,8 @@
5 * "Support" empty repositories; print an appropriate error.
6 (Jelmer Vernooij, #1219424)
7
8+ * Fix compatibility with and depend on dulwich 0.9.6. (William Grant)
9+
10 0.6.12 2013-09-22
11
12 FEATURES
13
14=== modified file 'fetch.py'
15--- fetch.py 2012-03-11 15:08:14 +0000
16+++ fetch.py 2015-05-10 00:53:31 +0000
17@@ -25,6 +25,7 @@
18 ZERO_SHA,
19 )
20 from dulwich.object_store import (
21+ ObjectStoreGraphWalker,
22 tree_lookup_path,
23 )
24 from dulwich.walk import Walker
25@@ -702,8 +703,9 @@
26 store.lock_write()
27 try:
28 heads = self.get_target_heads()
29- graph_walker = store.get_graph_walker(
30- [store._lookup_revision_sha1(head) for head in heads])
31+ graph_walker = ObjectStoreGraphWalker(
32+ [store._lookup_revision_sha1(head) for head in heads],
33+ store)
34 wants_recorder = DetermineWantsRecorder(determine_wants)
35
36 pb = ui.ui_factory.nested_progress_bar()
37
38=== modified file 'info.py'
39--- info.py 2013-09-22 21:15:30 +0000
40+++ info.py 2015-05-10 00:53:31 +0000
41@@ -2,7 +2,7 @@
42
43 bzr_plugin_name = "git"
44
45-dulwich_minimum_version = (0, 9, 1)
46+dulwich_minimum_version = (0, 9, 6)
47
48 # versions ending in 'exp' mean experimental mappings
49 # versions ending in 'dev' mean development version
50
51=== modified file 'tests/test_fetch.py'
52--- tests/test_fetch.py 2011-10-10 12:02:14 +0000
53+++ tests/test_fetch.py 2015-05-10 00:53:31 +0000
54@@ -297,7 +297,7 @@
55 gitsha = marks[mark]
56 tag = Tag()
57 tag.name = "sometag"
58- tag.tag_time = time.time()
59+ tag.tag_time = int(time.time())
60 tag.tag_timezone = 0
61 tag.tagger = "Somebody <somebody@example.com>"
62 tag.message = "Created tag pointed at tree"
63
64=== modified file 'tests/test_transportgit.py'
65--- tests/test_transportgit.py 2010-12-25 01:23:48 +0000
66+++ tests/test_transportgit.py 2015-05-10 00:53:31 +0000
67@@ -17,8 +17,10 @@
68 """Tests for bzr-git's object store."""
69
70
71+from dulwich.objects import Blob
72 from dulwich.tests.test_object_store import PackBasedObjectStoreTests
73-from dulwich.tests.test_repository import RefsContainerTests
74+from dulwich.tests.test_refs import RefsContainerTests
75+from dulwich.tests.utils import make_object
76
77 from bzrlib.tests import TestCaseWithTransport
78
79@@ -35,6 +37,22 @@
80 PackBasedObjectStoreTests.tearDown(self)
81 TestCaseWithTransport.tearDown(self)
82
83+ def test_remembers_packs(self):
84+ self.store.add_object(make_object(Blob, data="data"))
85+ self.assertEqual(0, len(self.store.packs))
86+ self.store.pack_loose_objects()
87+ self.assertEqual(1, len(self.store.packs))
88+
89+ # Packing a second object creates a second pack.
90+ self.store.add_object(make_object(Blob, data="more data"))
91+ self.store.pack_loose_objects()
92+ self.assertEqual(2, len(self.store.packs))
93+
94+ # If we reopen the store, it reloads both packs.
95+ restore = TransportObjectStore(self.get_transport())
96+ self.assertEqual(2, len(restore.packs))
97+
98+
99 # FIXME: Unfortunately RefsContainerTests requires on a specific set of refs existing.
100
101 # class TransportRefContainerTests(RefsContainerTests, TestCaseWithTransport):
102
103=== modified file 'transportgit.py'
104--- transportgit.py 2013-09-22 21:14:37 +0000
105+++ transportgit.py 2015-05-10 00:53:31 +0000
106@@ -411,9 +411,6 @@
107 def __repr__(self):
108 return "%s(%r)" % (self.__class__.__name__, self.transport)
109
110- def _pack_cache_stale(self):
111- return False # FIXME
112-
113 @property
114 def alternates(self):
115 if self._alternates is not None:
116@@ -442,6 +439,17 @@
117 finally:
118 f.close()
119
120+ @property
121+ def packs(self):
122+ # FIXME: Never invalidates.
123+ if not self._pack_cache:
124+ self._update_pack_cache()
125+ return self._pack_cache.values()
126+
127+ def _update_pack_cache(self):
128+ for pack in self._load_packs():
129+ self._pack_cache[pack._basename] = pack
130+
131 def _pack_names(self):
132 try:
133 f = self.transport.get('info/packs')
134@@ -475,6 +483,7 @@
135 idxname = name.replace(".pack", ".idx")
136 idx = load_pack_index_file(idxname, self.pack_transport.get(idxname))
137 pack = Pack.from_objects(pd, idx)
138+ pack._basename = idxname[:-5]
139 ret.append(pack)
140 return ret
141
142@@ -536,7 +545,7 @@
143 idxfile = self.pack_transport.get(basename + ".idx")
144 idx = load_pack_index_file(basename+".idx", idxfile)
145 final_pack = Pack.from_objects(p, idx)
146- self._add_known_pack(final_pack)
147+ self._add_known_pack(basename, final_pack)
148 return final_pack
149
150 def add_thin_pack(self):
151@@ -582,8 +591,9 @@
152 write_pack_index_v2(idxfile, data.sorted_entries(), data_sum)
153 finally:
154 idxfile.close()
155- final_pack = Pack("pack-%s" % pack_sha)
156- self._add_known_pack(final_pack)
157+ basename = "pack-%s" % pack_sha
158+ final_pack = Pack(basename)
159+ self._add_known_pack(basename, final_pack)
160 return final_pack
161
162 def add_pack(self):

Subscribers

People subscribed via source and target branches

to all changes: