diff mercurial/filelog.py @ 39883:3e896b51aa5d

storageutil: move metadata parsing and packing from revlog (API) Parsing and writing of revision text metadata is likely identical across storage backends. Let's move the code out of revlog so we don't need to import the revlog module in order to use it. Differential Revision: https://phab.mercurial-scm.org/D4754
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 24 Sep 2018 14:31:31 -0700
parents a269fa55467e
children 1b65fb4d43d6
line wrap: on
line diff
--- a/mercurial/filelog.py	Mon Sep 24 14:23:54 2018 -0700
+++ b/mercurial/filelog.py	Mon Sep 24 14:31:31 2018 -0700
@@ -14,6 +14,7 @@
 )
 from .utils import (
     interfaceutil,
+    storageutil,
 )
 
 @interfaceutil.implementer(repository.ifilestorage)
@@ -120,14 +121,14 @@
 
     def add(self, text, meta, transaction, link, p1=None, p2=None):
         if meta or text.startswith('\1\n'):
-            text = revlog.packmeta(meta, text)
+            text = storageutil.packmeta(meta, text)
         return self.addrevision(text, transaction, link, p1, p2)
 
     def renamed(self, node):
         if self.parents(node)[0] != revlog.nullid:
             return False
         t = self.revision(node)
-        m = revlog.parsemeta(t)[0]
+        m = storageutil.parsemeta(t)[0]
         # copy and copyrev occur in pairs. In rare cases due to bugs,
         # one can occur without the other.
         if m and "copy" in m and "copyrev" in m: