Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/localrepo.py @ 2147:b7225adb2e0b
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Thu, 27 Apr 2006 22:10:45 -0700 |
parents | 3053fc33f545 |
children | 43ce1c17e644 |
comparison
equal
deleted
inserted
replaced
2146:eb1ed410aa34 | 2147:b7225adb2e0b |
---|---|
40 self.ui.readconfig(self.join("hgrc"), self.root) | 40 self.ui.readconfig(self.join("hgrc"), self.root) |
41 except IOError: | 41 except IOError: |
42 pass | 42 pass |
43 | 43 |
44 v = self.ui.revlogopts | 44 v = self.ui.revlogopts |
45 self.revlogversion = int(v.get('format', 0)) | 45 self.revlogversion = int(v.get('format', revlog.REVLOGV0)) |
46 flags = 0 | 46 flags = 0 |
47 for x in v.get('flags', "").split(): | 47 for x in v.get('flags', "").split(): |
48 flags |= revlog.flagstr(x) | 48 flags |= revlog.flagstr(x) |
49 | 49 |
50 v = self.revlogversion | flags | 50 v = self.revlogversion | flags |
1801 def verify(self): | 1801 def verify(self): |
1802 filelinkrevs = {} | 1802 filelinkrevs = {} |
1803 filenodes = {} | 1803 filenodes = {} |
1804 changesets = revisions = files = 0 | 1804 changesets = revisions = files = 0 |
1805 errors = [0] | 1805 errors = [0] |
1806 warnings = [0] | |
1806 neededmanifests = {} | 1807 neededmanifests = {} |
1807 | 1808 |
1808 def err(msg): | 1809 def err(msg): |
1809 self.ui.warn(msg + "\n") | 1810 self.ui.warn(msg + "\n") |
1810 errors[0] += 1 | 1811 errors[0] += 1 |
1812 | |
1813 def warn(msg): | |
1814 self.ui.warn(msg + "\n") | |
1815 warnings[0] += 1 | |
1811 | 1816 |
1812 def checksize(obj, name): | 1817 def checksize(obj, name): |
1813 d = obj.checksize() | 1818 d = obj.checksize() |
1814 if d[0]: | 1819 if d[0]: |
1815 err(_("%s data length off by %d bytes") % (name, d[0])) | 1820 err(_("%s data length off by %d bytes") % (name, d[0])) |
1816 if d[1]: | 1821 if d[1]: |
1817 err(_("%s index contains %d extra bytes") % (name, d[1])) | 1822 err(_("%s index contains %d extra bytes") % (name, d[1])) |
1823 | |
1824 def checkversion(obj, name): | |
1825 if obj.version != revlog.REVLOGV0: | |
1826 if not revlogv1: | |
1827 warn(_("warning: `%s' uses revlog format 1") % name) | |
1828 elif revlogv1: | |
1829 warn(_("warning: `%s' uses revlog format 0") % name) | |
1830 | |
1831 revlogv1 = self.revlogversion != revlog.REVLOGV0 | |
1832 self.ui.status(_("repository uses revlog format %d\n") % | |
1833 (revlogv1 and 1 or 0)) | |
1818 | 1834 |
1819 seen = {} | 1835 seen = {} |
1820 self.ui.status(_("checking changesets\n")) | 1836 self.ui.status(_("checking changesets\n")) |
1821 checksize(self.changelog, "changelog") | 1837 checksize(self.changelog, "changelog") |
1822 | 1838 |
1848 for f in changes[3]: | 1864 for f in changes[3]: |
1849 filelinkrevs.setdefault(f, []).append(i) | 1865 filelinkrevs.setdefault(f, []).append(i) |
1850 | 1866 |
1851 seen = {} | 1867 seen = {} |
1852 self.ui.status(_("checking manifests\n")) | 1868 self.ui.status(_("checking manifests\n")) |
1869 checkversion(self.manifest, "manifest") | |
1853 checksize(self.manifest, "manifest") | 1870 checksize(self.manifest, "manifest") |
1854 | 1871 |
1855 for i in range(self.manifest.count()): | 1872 for i in range(self.manifest.count()): |
1856 n = self.manifest.node(i) | 1873 n = self.manifest.node(i) |
1857 l = self.manifest.linkrev(n) | 1874 l = self.manifest.linkrev(n) |
1912 files += 1 | 1929 files += 1 |
1913 if not f: | 1930 if not f: |
1914 err(_("file without name in manifest %s") % short(n)) | 1931 err(_("file without name in manifest %s") % short(n)) |
1915 continue | 1932 continue |
1916 fl = self.file(f) | 1933 fl = self.file(f) |
1934 checkversion(fl, f) | |
1917 checksize(fl, f) | 1935 checksize(fl, f) |
1918 | 1936 |
1919 nodes = {nullid: 1} | 1937 nodes = {nullid: 1} |
1920 seen = {} | 1938 seen = {} |
1921 for i in range(fl.count()): | 1939 for i in range(fl.count()): |
1960 err(_("node %s in manifests not in %s") % (hex(node), f)) | 1978 err(_("node %s in manifests not in %s") % (hex(node), f)) |
1961 | 1979 |
1962 self.ui.status(_("%d files, %d changesets, %d total revisions\n") % | 1980 self.ui.status(_("%d files, %d changesets, %d total revisions\n") % |
1963 (files, changesets, revisions)) | 1981 (files, changesets, revisions)) |
1964 | 1982 |
1983 if warnings[0]: | |
1984 self.ui.warn(_("%d warnings encountered!\n") % warnings[0]) | |
1965 if errors[0]: | 1985 if errors[0]: |
1966 self.ui.warn(_("%d integrity errors encountered!\n") % errors[0]) | 1986 self.ui.warn(_("%d integrity errors encountered!\n") % errors[0]) |
1967 return 1 | 1987 return 1 |
1968 | 1988 |
1969 # used to avoid circular references so destructors work | 1989 # used to avoid circular references so destructors work |