comparison mercurial/revlog.py @ 2222:c9e264b115e6

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
author mason@suse.com
date Mon, 08 May 2006 14:26:18 -0500
parents 6886bc0b77af
children 45aef5ddcdbe
comparison
equal deleted inserted replaced
2221:05b6c13f43c6 2222:c9e264b115e6
20 REVLOGV0 = 0 20 REVLOGV0 = 0
21 REVLOGNG = 1 21 REVLOGNG = 1
22 22
23 # revlog flags 23 # revlog flags
24 REVLOGNGINLINEDATA = (1 << 16) 24 REVLOGNGINLINEDATA = (1 << 16)
25 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
26
27 REVLOG_DEFAULT_FORMAT = REVLOGNG
28 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
25 29
26 def flagstr(flag): 30 def flagstr(flag):
27 if flag == "inline": 31 if flag == "inline":
28 return REVLOGNGINLINEDATA 32 return REVLOGNGINLINEDATA
29 raise RevlogError(_("unknown revlog flag %s" % flag)) 33 raise RevlogError(_("unknown revlog flag %s" % flag))
291 Both pieces of the revlog are written to in an append-only 295 Both pieces of the revlog are written to in an append-only
292 fashion, which means we never need to rewrite a file to insert or 296 fashion, which means we never need to rewrite a file to insert or
293 remove data, and can use some simple techniques to avoid the need 297 remove data, and can use some simple techniques to avoid the need
294 for locking while reading. 298 for locking while reading.
295 """ 299 """
296 def __init__(self, opener, indexfile, datafile, defversion=REVLOGV0): 300 def __init__(self, opener, indexfile, datafile,
301 defversion=REVLOG_DEFAULT_VERSION):
297 """ 302 """
298 create a revlog object 303 create a revlog object
299 304
300 opener is a function that abstracts the file opening operation 305 opener is a function that abstracts the file opening operation
301 and can be used to implement COW semantics or the like. 306 and can be used to implement COW semantics or the like.