]> arthur.barton.de Git - bup.git/commitdiff
PackWriter: rename write() to just_write()
authorRob Browning <rlb@defaultvalue.org>
Sun, 6 Nov 2016 19:42:08 +0000 (13:42 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 6 Nov 2016 19:42:10 +0000 (13:42 -0600)
Hopefully make the function's purpose a bit clearer.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/gc.py
lib/bup/git.py

index d85de74e80b5d514861fd22e9aa1dddfb223f337..3167ef57334e7f71cb88ba54e91be156e334c6cc 100644 (file)
@@ -185,7 +185,7 @@ def sweep(live_objects, existing_count, cat_pipe, threshold, compression,
             if live_objects.exists(sha):
                 item_it = cat_pipe.get(sha.encode('hex'))
                 type = item_it.next()
-                writer.write(sha, type, ''.join(item_it))
+                writer.just_write(sha, type, ''.join(item_it))
 
         ns.stale_files.append(idx_name)
         ns.stale_files.append(idx_name[:-3] + 'pack')
index fa2ad2152893d1ec289ae82302d4e371f40d3560..989936dd1e6858d7bd22a3cf8dbc1ac1f79af276 100644 (file)
@@ -675,15 +675,16 @@ class PackWriter:
         self._require_objcache()
         return self.objcache.exists(id, want_source=want_source)
 
-    def write(self, sha, type, content):
-        """Write an object to the pack file.  Fails if sha exists()."""
+    def just_write(self, sha, type, content):
+        """Write an object to the pack file, bypassing the objcache.  Fails if
+        sha exists()."""
         self._write(sha, type, content)
 
     def maybe_write(self, type, content):
         """Write an object to the pack file if not present and return its id."""
         sha = calc_hash(type, content)
         if not self.exists(sha):
-            self.write(sha, type, content)
+            self.just_write(sha, type, content)
             self._require_objcache()
             self.objcache.add(sha)
         return sha