trouble with .hgignore and hg pull

Matt Mackall mpm at selenic.com
Thu Aug 4 13:10:54 CDT 2005


On Thu, Aug 04, 2005 at 07:53:40PM +0200, Benedikt Spranger wrote:
> On Thu, Aug 04, 2005 at 10:21 -0700, Matt Mackall wrote:
> > On Thu, Aug 04, 2005 at 06:35:09PM +0200, Benedikt Spranger wrote:
> > > On Thu, Aug 04, 2005 at 08:27 -0700, Matt Mackall wrote: 
> > > > On Thu, Aug 04, 2005 at 01:30:50PM +0200, Benedikt Spranger wrote:
> > > > > IOError: [Errno 2] No such file or directory:
> > > > > '/path/to/hg/repos/A/.hg/data/.hgignore.d'
> > > > Does that file exist? 
> > > No, .hg/data/.hgignore.i exists, .hg/data/.hgignore.d not. 
> > That's bad.
> As a workaround I removed .hgignore and I was able to pull. 
> After re-adding the .hgignore and pulling, I trigger a other Problem.
> I reached a key error in revlog.py. /path/to/B/.hg/.hgignore.i and 
> .hgignore.d exists, but they are 0 Bytes long. The following patch
> throws a more verbose Errormessage.
> 
> ---8<---
> diff -r eef752151556 mercurial/revlog.py
> --- a/mercurial/revlog.py       Tue Aug  2 07:34:23 2005
> +++ b/mercurial/revlog.py       Thu Aug  4 19:44:34 2005
> @@ -157,7 +157,13 @@
>      def tip(self): return self.node(len(self.index) - 1)
>      def count(self): return len(self.index)
>      def node(self, rev): return (rev < 0) and nullid or self.index
> [rev][6]
> -    def rev(self, node): return self.nodemap[node]
> +    def rev(self, node):
> +       try:
> +           ret = self.nodemap[node]
> +       except KeyError:
> +           raise KeyError("File: >" + self.datafile + "< node " + hex
> (node))
> +       return ret
> +
>      def linkrev(self, node): return self.index[self.nodemap[node]][3]
>      def parents(self, node):
>          if node == nullid: return (nullid, nullid)
> ---8<---
> 
> > 6000 errors? Ouch!
> > > How can I restore this repository?
> > Well, we can't really fix missing files. Is this the kernel repo?
> Yes. I setup some repos for different Boards and Kernelsubtrees.
> The .hgignore thing was the first problem I reached.
> 
> > How did it get in this state? 
> I cloned a git-converted Tree.
> 17446 files, 2391 changesets, 32019 total revisions
> 6836 integrity errors encountered!

Ahh. What did you convert them with? contrib/convert-repo?

There are some nasty silent problems with older copies of convert-repo
that appeared when the git packing was added. Old convert-repo read
git blobs directly, and if it tried to read a blob that had been
packed, it wouldn't find it and would assume it had been deleted. This
resulted in tons of integrity errors.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list