Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 1853:5ac811b720de
Fix some problems when working on broken repositories:
Fix tracebacks in hg verify for certain repo errors.
Print compression type byte encoded safely.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 08 Mar 2006 00:27:23 +0100 |
parents | 876e4e6ad82b |
children | 05c7d75be925 |
comparison
equal
deleted
inserted
replaced
1852:fdf9cbf56ec7 | 1853:5ac811b720de |
---|---|
1769 except KeyboardInterrupt: | 1769 except KeyboardInterrupt: |
1770 self.ui.warn(_("interrupted")) | 1770 self.ui.warn(_("interrupted")) |
1771 raise | 1771 raise |
1772 except Exception, inst: | 1772 except Exception, inst: |
1773 err(_("unpacking changeset %s: %s") % (short(n), inst)) | 1773 err(_("unpacking changeset %s: %s") % (short(n), inst)) |
1774 continue | |
1774 | 1775 |
1775 neededmanifests[changes[0]] = n | 1776 neededmanifests[changes[0]] = n |
1776 | 1777 |
1777 for f in changes[3]: | 1778 for f in changes[3]: |
1778 filelinkrevs.setdefault(f, []).append(i) | 1779 filelinkrevs.setdefault(f, []).append(i) |
1806 except KeyboardInterrupt: | 1807 except KeyboardInterrupt: |
1807 self.ui.warn(_("interrupted")) | 1808 self.ui.warn(_("interrupted")) |
1808 raise | 1809 raise |
1809 except Exception, inst: | 1810 except Exception, inst: |
1810 err(_("unpacking manifest %s: %s") % (short(n), inst)) | 1811 err(_("unpacking manifest %s: %s") % (short(n), inst)) |
1811 | 1812 continue |
1812 ff = [ l.split('\0') for l in delta.splitlines() ] | 1813 |
1813 for f, fn in ff: | 1814 try: |
1814 filenodes.setdefault(f, {})[bin(fn[:40])] = 1 | 1815 ff = [ l.split('\0') for l in delta.splitlines() ] |
1816 for f, fn in ff: | |
1817 filenodes.setdefault(f, {})[bin(fn[:40])] = 1 | |
1818 except (ValueError, TypeError), inst: | |
1819 err(_("broken delta in manifest %s: %s") % (short(n), inst)) | |
1815 | 1820 |
1816 self.ui.status(_("crosschecking files in changesets and manifests\n")) | 1821 self.ui.status(_("crosschecking files in changesets and manifests\n")) |
1817 | 1822 |
1818 for m, c in neededmanifests.items(): | 1823 for m, c in neededmanifests.items(): |
1819 err(_("Changeset %s refers to unknown manifest %s") % | 1824 err(_("Changeset %s refers to unknown manifest %s") % |
1833 ff.sort() | 1838 ff.sort() |
1834 for f in ff: | 1839 for f in ff: |
1835 if f == "/dev/null": | 1840 if f == "/dev/null": |
1836 continue | 1841 continue |
1837 files += 1 | 1842 files += 1 |
1843 if not f: | |
1844 err(_("file without name in manifest %s") % short(n)) | |
1845 continue | |
1838 fl = self.file(f) | 1846 fl = self.file(f) |
1839 checksize(fl, f) | 1847 checksize(fl, f) |
1840 | 1848 |
1841 nodes = {nullid: 1} | 1849 nodes = {nullid: 1} |
1842 seen = {} | 1850 seen = {} |
1850 err(_("%s: %d:%s not in manifests") % (f, i, short(n))) | 1858 err(_("%s: %d:%s not in manifests") % (f, i, short(n))) |
1851 else: | 1859 else: |
1852 del filenodes[f][n] | 1860 del filenodes[f][n] |
1853 | 1861 |
1854 flr = fl.linkrev(n) | 1862 flr = fl.linkrev(n) |
1855 if flr not in filelinkrevs[f]: | 1863 if flr not in filelinkrevs.get(f, []): |
1856 err(_("%s:%s points to unexpected changeset %d") | 1864 err(_("%s:%s points to unexpected changeset %d") |
1857 % (f, short(n), flr)) | 1865 % (f, short(n), flr)) |
1858 else: | 1866 else: |
1859 filelinkrevs[f].remove(flr) | 1867 filelinkrevs[f].remove(flr) |
1860 | 1868 |