equal
deleted
inserted
replaced
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. |