merge with crew.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Thu, 27 Apr 2006 22:10:45 -0700
changeset 2147 b7225adb2e0b
parent 2146 eb1ed410aa34 (current diff)
parent 2143 3053fc33f545 (diff)
child 2148 c72e618c1204
merge with crew.
--- a/mercurial/changelog.py	Thu Apr 27 22:01:57 2006 -0700
+++ b/mercurial/changelog.py	Thu Apr 27 22:10:45 2006 -0700
@@ -11,7 +11,7 @@
 demandload(globals(), "os time util")
 
 class changelog(revlog):
-    def __init__(self, opener, defversion=0):
+    def __init__(self, opener, defversion=REVLOGV0):
         revlog.__init__(self, opener, "00changelog.i", "00changelog.d",
                         defversion)
 
--- a/mercurial/commands.py	Thu Apr 27 22:01:57 2006 -0700
+++ b/mercurial/commands.py	Thu Apr 27 22:10:45 2006 -0700
@@ -2978,7 +2978,7 @@
           ('a', 'text', None, _('treat all files as text')),
           ('', 'switch-parent', None, _('diff against the second parent'))],
          _('hg export [-a] [-o OUTFILESPEC] REV...')),
-    "forget":
+    "debugforget|forget":
         (forget,
          [('I', 'include', [], _('include names matching the given patterns')),
           ('X', 'exclude', [], _('exclude names matching the given patterns'))],
--- a/mercurial/localrepo.py	Thu Apr 27 22:01:57 2006 -0700
+++ b/mercurial/localrepo.py	Thu Apr 27 22:10:45 2006 -0700
@@ -42,7 +42,7 @@
             pass
 
         v = self.ui.revlogopts
-        self.revlogversion = int(v.get('format', 0))
+        self.revlogversion = int(v.get('format', revlog.REVLOGV0))
         flags = 0
         for x in v.get('flags', "").split():
             flags |= revlog.flagstr(x)
@@ -1803,12 +1803,17 @@
         filenodes = {}
         changesets = revisions = files = 0
         errors = [0]
+        warnings = [0]
         neededmanifests = {}
 
         def err(msg):
             self.ui.warn(msg + "\n")
             errors[0] += 1
 
+        def warn(msg):
+            self.ui.warn(msg + "\n")
+            warnings[0] += 1
+
         def checksize(obj, name):
             d = obj.checksize()
             if d[0]:
@@ -1816,6 +1821,17 @@
             if d[1]:
                 err(_("%s index contains %d extra bytes") % (name, d[1]))
 
+        def checkversion(obj, name):
+            if obj.version != revlog.REVLOGV0:
+                if not revlogv1:
+                    warn(_("warning: `%s' uses revlog format 1") % name)
+            elif revlogv1:
+                warn(_("warning: `%s' uses revlog format 0") % name)
+
+        revlogv1 = self.revlogversion != revlog.REVLOGV0
+        self.ui.status(_("repository uses revlog format %d\n") %
+                       (revlogv1 and 1 or 0))
+
         seen = {}
         self.ui.status(_("checking changesets\n"))
         checksize(self.changelog, "changelog")
@@ -1850,6 +1866,7 @@
 
         seen = {}
         self.ui.status(_("checking manifests\n"))
+        checkversion(self.manifest, "manifest")
         checksize(self.manifest, "manifest")
 
         for i in range(self.manifest.count()):
@@ -1914,6 +1931,7 @@
                 err(_("file without name in manifest %s") % short(n))
                 continue
             fl = self.file(f)
+            checkversion(fl, f)
             checksize(fl, f)
 
             nodes = {nullid: 1}
@@ -1962,6 +1980,8 @@
         self.ui.status(_("%d files, %d changesets, %d total revisions\n") %
                        (files, changesets, revisions))
 
+        if warnings[0]:
+            self.ui.warn(_("%d warnings encountered!\n") % warnings[0])
         if errors[0]:
             self.ui.warn(_("%d integrity errors encountered!\n") % errors[0])
             return 1
--- a/mercurial/manifest.py	Thu Apr 27 22:01:57 2006 -0700
+++ b/mercurial/manifest.py	Thu Apr 27 22:10:45 2006 -0700
@@ -12,7 +12,7 @@
 demandload(globals(), "bisect array")
 
 class manifest(revlog):
-    def __init__(self, opener, defversion=0):
+    def __init__(self, opener, defversion=REVLOGV0):
         self.mapcache = None
         self.listcache = None
         revlog.__init__(self, opener, "00manifest.i", "00manifest.d",
--- a/mercurial/revlog.py	Thu Apr 27 22:01:57 2006 -0700
+++ b/mercurial/revlog.py	Thu Apr 27 22:10:45 2006 -0700
@@ -293,7 +293,7 @@
     remove data, and can use some simple techniques to avoid the need
     for locking while reading.
     """
-    def __init__(self, opener, indexfile, datafile, defversion=0):
+    def __init__(self, opener, indexfile, datafile, defversion=REVLOGV0):
         """
         create a revlog object
 
@@ -337,7 +337,7 @@
                 v = struct.unpack(versionformat, i)[0]
         flags = v & ~0xFFFF
         fmt = v & 0xFFFF
-        if fmt == 0:
+        if fmt == REVLOGV0:
             if flags:
                 raise RevlogError(_("index %s invalid flags %x for format v0" %
                                    (self.indexfile, flags)))
@@ -349,7 +349,7 @@
             raise RevlogError(_("index %s invalid format %d" %
                                (self.indexfile, fmt)))
         self.version = v
-        if v == 0:
+        if v == REVLOGV0:
             self.indexformat = indexformatv0
             shaoffset = v0shaoffset
         else:
@@ -369,7 +369,7 @@
                 # we've already got the entire data file read in, save it
                 # in the chunk data
                 self.chunkcache = (0, i)
-            if self.version != 0:
+            if self.version != REVLOGV0:
                 e = list(self.index[0])
                 type = self.ngtype(e[0])
                 e[0] = self.offset_type(0, type)
@@ -399,7 +399,7 @@
     def ngoffset(self, q):
         if q & 0xFFFF:
             raise RevlogError(_('%s: incompatible revision flag %x') %
-                               (self.indexfile, type))
+                              (self.indexfile, q))
         return long(q >> 16)
 
     def ngtype(self, q):
@@ -441,13 +441,13 @@
         if node == nullid: return (nullid, nullid)
         r = self.rev(node)
         d = self.index[r][-3:-1]
-        if self.version == 0:
+        if self.version == REVLOGV0:
             return d
         return [ self.node(x) for x in d ]
     def start(self, rev):
         if rev < 0:
             return -1
-        if self.version != 0:
+        if self.version != REVLOGV0:
             return self.ngoffset(self.index[rev][0])
         return self.index[rev][0]
 
@@ -456,7 +456,7 @@
     def size(self, rev):
         """return the length of the uncompressed text for a given revision"""
         l = -1
-        if self.version != 0:
+        if self.version != REVLOGV0:
             l = self.index[rev][2]
         if l >= 0:
             return l
@@ -911,7 +911,7 @@
         if t >= 0:
             offset = self.end(t)
 
-        if self.version == 0:
+        if self.version == REVLOGV0:
             e = (offset, l, base, link, p1, p2, node)
         else:
             e = (self.offset_type(offset, 0), l, len(text),
@@ -935,7 +935,7 @@
             f.seek(0, 2)
             transaction.add(self.indexfile, f.tell(), self.count() - 1)
 
-        if len(self.index) == 1 and self.version != 0:
+        if len(self.index) == 1 and self.version != REVLOGV0:
             l = struct.pack(versionformat, self.version)
             f.write(l)
             entry = entry[4:]
@@ -1135,7 +1135,7 @@
                     raise RevlogError(_("consistency error adding group"))
                 textlen = len(text)
             else:
-                if self.version == 0:
+                if self.version == REVLOGV0:
                     e = (end, len(cdelta), base, link, p1, p2, node)
                 else:
                     e = (self.offset_type(end, 0), len(cdelta), textlen, base,
--- a/tests/test-basic.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-basic.out	Thu Apr 27 22:10:45 2006 -0700
@@ -6,6 +6,7 @@
 
 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
 a
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-clone-pull-corruption.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-clone-pull-corruption.out	Thu Apr 27 22:10:45 2006 -0700
@@ -8,6 +8,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 (run 'hg update' to get a working copy)
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-clone-r.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-clone-r.out	Thu Apr 27 22:10:45 2006 -0700
@@ -17,6 +17,7 @@
      4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
      5       250      68      3       7 3b45cc2ab868 de68e904d169 000000000000
      6       318      54      6       8 24d86153a002 f54c32f13478 000000000000
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -27,6 +28,7 @@
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -37,6 +39,7 @@
 adding manifests
 adding file changes
 added 2 changesets with 2 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -47,6 +50,7 @@
 adding manifests
 adding file changes
 added 3 changesets with 3 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -57,6 +61,7 @@
 adding manifests
 adding file changes
 added 4 changesets with 4 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -67,6 +72,7 @@
 adding manifests
 adding file changes
 added 2 changesets with 2 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -77,6 +83,7 @@
 adding manifests
 adding file changes
 added 3 changesets with 3 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -87,6 +94,7 @@
 adding manifests
 adding file changes
 added 4 changesets with 5 changes to 2 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -97,6 +105,7 @@
 adding manifests
 adding file changes
 added 5 changesets with 6 changes to 3 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -107,6 +116,7 @@
 adding manifests
 adding file changes
 added 5 changesets with 5 changes to 2 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -119,6 +129,7 @@
 adding file changes
 added 4 changesets with 2 changes to 3 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-clone.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-clone.out	Thu Apr 27 22:10:45 2006 -0700
@@ -1,10 +1,12 @@
 a
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 1 files, 1 changesets, 1 total revisions
 a not present
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-copy.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-copy.out	Thu Apr 27 22:10:45 2006 -0700
@@ -44,6 +44,7 @@
 566e338d09a089ba737c21e0d3759980  .hg/data/b.d
 60b725f10c9c85c70d97880dfe8191b3  bsum
 60b725f10c9c85c70d97880dfe8191b3  asum
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-empty.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-empty.out	Thu Apr 27 22:10:45 2006 -0700
@@ -1,3 +1,4 @@
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-excessive-merge.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-excessive-merge.out	Thu Apr 27 22:10:45 2006 -0700
@@ -52,6 +52,7 @@
    rev    offset  length   base linkrev nodeid       p1           p2
      0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
      1         5       6      1       1 79d7492df40a 2ed2a3912a0b 000000000000
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-filebranch.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-filebranch.out	Thu Apr 27 22:10:45 2006 -0700
@@ -65,6 +65,7 @@
 aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
 everything should be clean now
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-help.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-help.out	Thu Apr 27 22:10:45 2006 -0700
@@ -49,7 +49,6 @@
  copy        mark files as copied for the next commit
  diff        diff repository (or selected files)
  export      dump the header and diffs for one or more changesets
- forget      don't add the specified files on the next commit (DEPRECATED)
  grep        search for a pattern in specified files and revisions
  heads       show current repository heads
  help        show help for a given command or all commands
@@ -92,7 +91,6 @@
  copy        mark files as copied for the next commit
  diff        diff repository (or selected files)
  export      dump the header and diffs for one or more changesets
- forget      don't add the specified files on the next commit (DEPRECATED)
  grep        search for a pattern in specified files and revisions
  heads       show current repository heads
  help        show help for a given command or all commands
--- a/tests/test-nested-repo.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-nested-repo.out	Thu Apr 27 22:10:45 2006 -0700
@@ -4,6 +4,5 @@
 # should print A b/x
 A b/x
 # should forget b/x
-(the forget command is deprecated; use revert instead)
 forgetting b/x
 # should print nothing
--- a/tests/test-permissions.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-permissions.out	Thu Apr 27 22:10:45 2006 -0700
@@ -1,13 +1,16 @@
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 1 files, 1 changesets, 1 total revisions
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 verify failed
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-pull-permission.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-pull-permission.out	Thu Apr 27 22:10:45 2006 -0700
@@ -3,6 +3,7 @@
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-pull-pull-corruption.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-pull-pull-corruption.out	Thu Apr 27 22:10:45 2006 -0700
@@ -17,6 +17,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-pull-pull-corruption2.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-pull-pull-corruption2.out	Thu Apr 27 22:10:45 2006 -0700
@@ -10,11 +10,13 @@
 adding manifests
 adding file changes
 added 10 changesets with 10 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
 checking files
 1 files, 10 changesets, 10 total revisions
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-pull.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-pull.out	Thu Apr 27 22:10:45 2006 -0700
@@ -1,4 +1,5 @@
 adding foo
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -9,6 +10,7 @@
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-push-r.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-push-r.out	Thu Apr 27 22:10:45 2006 -0700
@@ -17,6 +17,7 @@
      4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
      5       250      68      3       7 3b45cc2ab868 de68e904d169 000000000000
      6       318      54      6       8 24d86153a002 f54c32f13478 000000000000
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -28,6 +29,7 @@
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -39,6 +41,7 @@
 adding manifests
 adding file changes
 added 2 changesets with 2 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -50,6 +53,7 @@
 adding manifests
 adding file changes
 added 3 changesets with 3 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -61,6 +65,7 @@
 adding manifests
 adding file changes
 added 4 changesets with 4 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -72,6 +77,7 @@
 adding manifests
 adding file changes
 added 2 changesets with 2 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -83,6 +89,7 @@
 adding manifests
 adding file changes
 added 3 changesets with 3 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -94,6 +101,7 @@
 adding manifests
 adding file changes
 added 4 changesets with 5 changes to 2 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -105,6 +113,7 @@
 adding manifests
 adding file changes
 added 5 changesets with 6 changes to 3 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -116,6 +125,7 @@
 adding manifests
 adding file changes
 added 5 changesets with 5 changes to 2 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -128,6 +138,7 @@
 adding file changes
 added 4 changesets with 2 changes to 3 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-simple-update.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-simple-update.out	Thu Apr 27 22:10:45 2006 -0700
@@ -1,4 +1,5 @@
 adding foo
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -11,6 +12,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 (run 'hg update' to get a working copy)
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-ssh.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-ssh.out	Thu Apr 27 22:10:45 2006 -0700
@@ -6,6 +6,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 # verify
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -48,6 +49,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     add
 
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-static-http.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-static-http.out	Thu Apr 27 22:10:45 2006 -0700
@@ -12,6 +12,7 @@
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
--- a/tests/test-undo.out	Thu Apr 27 22:01:57 2006 -0700
+++ b/tests/test-undo.out	Thu Apr 27 22:10:45 2006 -0700
@@ -1,3 +1,4 @@
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests
@@ -10,6 +11,7 @@
 summary:     test
 
 rolling back last transaction
+repository uses revlog format 0
 checking changesets
 checking manifests
 crosschecking files in changesets and manifests