Patchwork [2,of,9,V3] manifest: remove dependency on treeinmem from manifest.add

mail settings
Submitter Durham Goode
Date Sept. 20, 2016, 7:36 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/16686/
State Superseded
Headers show


Durham Goode - Sept. 20, 2016, 7:36 p.m.
# HG changeset patch
# User Durham Goode <>
# Date 1474399441 25200
#      Tue Sep 20 12:24:01 2016 -0700
# Node ID 4226fad2f4df52579581bab6cc6111e243b8000d
# Parent  952e434dd3b51dfdfbfd370dfa85f66929757be0
manifest: remove dependency on treeinmem from manifest.add

Currently manifest.add uses the treeinmem option to know if it can call
fastdelta on the given manifest instance. In a future patch we will be moving
add() to be on the manifestrevlog, so it won't have access to the treeinmem
option anymore. Instead, let's have it actually check if the given manifest
instance supports the fastdelta operation.

This also means that if treemanifest or any implementation eventually implements
fastdelta(), it will automatically benefit from this code path.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -1234,7 +1234,7 @@  class manifest(manifestrevlog):
             return None, None
     def add(self, m, transaction, link, p1, p2, added, removed):
-        if (p1 in self.fulltextcache and not self._treeinmem
+        if (p1 in self.fulltextcache and util.safehasattr(m, 'fastdelta')
             and not self._usemanifestv2):
             # If our first parent is in the manifest cache, we can
             # compute a delta here using properties we know about the