revlog: remove support for punched/shallow
authorSune Foldager <cryo@cyanite.org>
Thu, 05 May 2011 12:46:02 +0200
changeset 14196 e7483ec3c374
parent 14195 0013d3eeb826
child 14197 c124341c4cea
revlog: remove support for punched/shallow The feature was never finished, and there has been restructuring going on since it was added.
mercurial/revlog.py
--- a/mercurial/revlog.py	Thu May 05 12:55:12 2011 +0200
+++ b/mercurial/revlog.py	Thu May 05 12:46:02 2011 +0200
@@ -34,8 +34,7 @@
 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW
 
 # revlog index flags
-REVIDX_PUNCHED_FLAG = 2
-REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG
+REVIDX_KNOWN_FLAGS = 0
 
 # max size of revlog with inline data
 _maxinline = 131072
@@ -891,8 +890,7 @@
 
     def _checkhash(self, text, node, rev):
         p1, p2 = self.parents(node)
-        if (node != hash(text, p1, p2) and
-            not (self.flags(rev) & REVIDX_PUNCHED_FLAG)):
+        if node != hash(text, p1, p2):
             raise RevlogError(_("integrity check failed on %s:%d")
                               % (self.indexfile, rev))
         return text
@@ -946,8 +944,7 @@
         cachedelta - an optional precomputed delta
         """
         node = hash(text, p1, p2)
-        if (node in self.nodemap and
-            (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
+        if node in self.nodemap:
             return node
 
         dfh = None
@@ -1009,14 +1006,12 @@
 
         # full versions are inserted when the needed deltas
         # become comparable to the uncompressed text
-        # or the base revision is punched
         if text is None:
             textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
                                         cachedelta[1])
         else:
             textlen = len(text)
-        if (d is None or dist > textlen * 2 or
-            (self.flags(base) & REVIDX_PUNCHED_FLAG)):
+        if d is None or dist > textlen * 2:
             text = buildtext()
             data = compress(text)
             l = len(data[1]) + len(data[0])
@@ -1120,32 +1115,15 @@
                 delta = chunkdata['delta']
 
                 link = linkmapper(cs)
-                if (node in self.nodemap and
-                    (not self.flags(self.rev(node)) & REVIDX_PUNCHED_FLAG)):
+                if node in self.nodemap:
                     # this can happen if two branches make the same change
                     chain = node
                     continue
 
                 for p in (p1, p2):
                     if not p in self.nodemap:
-                        if self._shallow:
-                            # add null entries for missing parents
-                            # XXX FIXME
-                            #if base == nullrev:
-                            #    base = len(self)
-                            #e = (offset_type(end, REVIDX_PUNCHED_FLAG),
-                            #     0, 0, base, nullrev, nullrev, nullrev, p)
-                            #self.index.insert(-1, e)
-                            #self.nodemap[p] = r
-                            #entry = self._io.packentry(e, self.node,
-                            #                           self.version, r)
-                            #ifh.write(entry)
-                            #t, r = r, r + 1
-                            raise LookupError(p, self.indexfile,
-                                              _('unknown parent'))
-                        else:
-                            raise LookupError(p, self.indexfile,
-                                              _('unknown parent'))
+                        raise LookupError(p, self.indexfile,
+                                          _('unknown parent'))
 
                 if deltabase not in self.nodemap:
                     raise LookupError(deltabase, self.indexfile,