Use revlogng and inlined data files by default
authormason@suse.com
Mon, 08 May 2006 14:26:18 -0500
changeset 2222 c9e264b115e6
parent 2221 05b6c13f43c6
child 2223 b72562060e45
Use revlogng and inlined data files by default This changes revlog specify revlogng by default. Inlined data files are also used unless a flags option is found in the .hgrc. Some example hgrc files: [revlog] # use the original revlog format format=0 [revlog] # use revlogng. Because no flags are included, inlined data files # also be selected format=1 [revlog] # use revlogng but do not inline the data files with the index flags= [revlog] # the new default format=1 flags=inline
mercurial/filelog.py
mercurial/localrepo.py
mercurial/revlog.py
--- a/mercurial/filelog.py	Mon May 08 10:59:58 2006 -0700
+++ b/mercurial/filelog.py	Mon May 08 14:26:18 2006 -0500
@@ -11,7 +11,7 @@
 demandload(globals(), "bdiff")
 
 class filelog(revlog):
-    def __init__(self, opener, path, defversion=0):
+    def __init__(self, opener, path, defversion=REVLOG_DEFAULT_VERSION):
         revlog.__init__(self, opener,
                         os.path.join("data", self.encodedir(path + ".i")),
                         os.path.join("data", self.encodedir(path + ".d")),
--- a/mercurial/localrepo.py	Mon May 08 10:59:58 2006 -0700
+++ b/mercurial/localrepo.py	Mon May 08 14:26:18 2006 -0500
@@ -43,11 +43,15 @@
             pass
 
         v = self.ui.revlogopts
-        self.revlogversion = int(v.get('format', revlog.REVLOGV0))
+        self.revlogversion = int(v.get('format', revlog.REVLOG_DEFAULT_FORMAT))
         self.revlogv1 = self.revlogversion != revlog.REVLOGV0
+        fl = v.get('flags', None)
         flags = 0
-        for x in v.get('flags', "").split():
-            flags |= revlog.flagstr(x)
+        if fl != None:
+            for x in fl.split():
+                flags |= revlog.flagstr(x)
+        elif self.revlogv1:
+            flags = revlog.REVLOG_DEFAULT_FLAGS
 
         v = self.revlogversion | flags
         self.manifest = manifest.manifest(self.opener, v)
--- a/mercurial/revlog.py	Mon May 08 10:59:58 2006 -0700
+++ b/mercurial/revlog.py	Mon May 08 14:26:18 2006 -0500
@@ -22,6 +22,10 @@
 
 # revlog flags
 REVLOGNGINLINEDATA = (1 << 16)
+REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
+
+REVLOG_DEFAULT_FORMAT = REVLOGNG
+REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
 
 def flagstr(flag):
     if flag == "inline":
@@ -293,7 +297,8 @@
     remove data, and can use some simple techniques to avoid the need
     for locking while reading.
     """
-    def __init__(self, opener, indexfile, datafile, defversion=REVLOGV0):
+    def __init__(self, opener, indexfile, datafile,
+                 defversion=REVLOG_DEFAULT_VERSION):
         """
         create a revlog object