Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 4302:d69bdc1091b8
Fixups for recent changes in revlog version handling
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 02 Apr 2007 14:16:44 -0500 |
parents | 0ce23256e454 |
children | aa26759c6fb3 |
comparison
equal
deleted
inserted
replaced
4301:f344440fdcb0 | 4302:d69bdc1091b8 |
---|---|
23 REVLOGNGINLINEDATA = (1 << 16) | 23 REVLOGNGINLINEDATA = (1 << 16) |
24 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA | 24 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA |
25 | 25 |
26 REVLOG_DEFAULT_FORMAT = REVLOGNG | 26 REVLOG_DEFAULT_FORMAT = REVLOGNG |
27 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS | 27 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS |
28 | |
29 def flagstr(flag): | |
30 if flag == "inline": | |
31 return REVLOGNGINLINEDATA | |
32 raise RevlogError(_("unknown revlog flag %s") % flag) | |
33 | 28 |
34 def hash(text, p1, p2): | 29 def hash(text, p1, p2): |
35 """generate a hash from the given text and its parent hashes | 30 """generate a hash from the given text and its parent hashes |
36 | 31 |
37 This hash combines both the current file contents and its history | 32 This hash combines both the current file contents and its history |
326 self.cache = None | 321 self.cache = None |
327 self.chunkcache = None | 322 self.chunkcache = None |
328 self.defversion = REVLOG_DEFAULT_VERSION | 323 self.defversion = REVLOG_DEFAULT_VERSION |
329 if hasattr(opener, "defversion"): | 324 if hasattr(opener, "defversion"): |
330 self.defversion = opener.defversion | 325 self.defversion = opener.defversion |
326 if self.defversion & REVLOGNG: | |
327 self.defversion |= REVLOGNGINLINEDATA | |
331 self.load() | 328 self.load() |
332 | 329 |
333 def load(self): | 330 def load(self): |
334 v = self.defversion | 331 v = self.defversion |
335 try: | 332 try: |