Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

BaseObjectStore.determine_wants_all no longer breaks on zero SHAs.

Changeset 8a2f5cefc032

Parent c1c8d0dd7add

by Jelmer Vernooij

Changes to 4 files · Browse files at 8a2f5cefc032 Showing diff from parent c1c8d0dd7add Diff from another changeset...

Change 1 of 1 Show Entire File NEWS Stacked
 
8
9
10
 
 
 
11
12
13
 
8
9
10
11
12
13
14
15
16
@@ -8,6 +8,9 @@
    * Fix get_transport_and_path compatibility with pre-2.6.5 versions of Python.   (Max Bowsher, #707438) + + * BaseObjectStore.determine_wants_all no longer breaks on zero SHAs. + (Jelmer Vernooij)     IMPROVEMENTS  
 
40
41
42
 
43
44
45
 
66
67
68
69
 
 
70
71
72
 
40
41
42
43
44
45
46
 
67
68
69
 
70
71
72
73
74
@@ -40,6 +40,7 @@
  ShaFile,   Tag,   Tree, + ZERO_SHA,   hex_to_sha,   sha_to_hex,   hex_to_filename, @@ -66,7 +67,8 @@
    def determine_wants_all(self, refs):   return [sha for (ref, sha) in refs.iteritems() - if not sha in self and not ref.endswith("^{}")] + if not sha in self and not ref.endswith("^{}") and + not sha == ZERO_SHA]     def iter_shas(self, shas):   """Iterate over the objects for the specified shas.
 
43
44
45
 
46
47
48
 
43
44
45
46
47
48
49
@@ -43,6 +43,7 @@
  TreeEntryTuple,   )   +ZERO_SHA = "0" * 40    # Header fields for commits  _TREE_HEADER = "tree"
 
57
58
59
 
 
 
 
 
 
 
 
60
61
62
 
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@@ -57,6 +57,14 @@
   class ObjectStoreTests(object):   + def test_determine_wants_all(self): + self.assertEquals(["1" * 40], + self.store.determine_wants_all({"refs/heads/foo": "1" * 40})) + + def test_determine_wants_all_zero(self): + self.assertEquals([], + self.store.determine_wants_all({"refs/heads/foo": "0" * 40})) +   def test_iter(self):   self.assertEquals([], list(self.store))