Corrupted repository... help?

Matt Mackall mpm at selenic.com
Mon Nov 19 20:26:07 UTC 2007


On Sat, Nov 17, 2007 at 06:59:37PM -0500, Bob Kuehne wrote:
> ok, i've narrowed in on the problem. as usual, it's user error, at  
> least, to a point. the propagation of badness, i'm not sure how it  
> happened. i tried a few small test repos corrupted as i'll describe  
> below, but couldn't reproduce the migrating corruptness. so, here's  
> how i initially corrupted my repository...
> 
> so, here's what happened:
> 
>  1) i use cmake to build lots of the stuff i do in this repository,  
> and i've got
>     a convention of creating directories named 'build' to store the  
> built stuff.
>  2) at some point i created a new project in the repo, did some  
> setup, and finally
>     did an 'hg add' on the root. and doh! i got my build directory too.
>  3) so, smart guy that i am (and since i was sending the repo in a  
> zip later too),
>     i did this:
> 	find . -name "build" -exec hg rm -f {} \;
>     and then for packing, i did this, to save some space in the zip:
> 	find . -name "build" -exec rm -rf {} \;
>  4) lo and behold, i had made this error before, and now had just  
> deleted not only
>     the real intermediate stuff, but a _checked_in_ version, one  
> which previously
>     had been in .hg/store/data/...
>  5) corrupt repo

Ouch. We might be able to do something fiddly with permissions to make
this a bit harder to do, but there's a limited amount of
bullet-proofing we can put in your footwear before you have trouble
walking.

We should probably make verify explicitly notice when particular
revlogs are missing (we generally treat missing revlogs as empty).

> i gather the .i extension is to distinguish these as compressed  
> internal files. could the
> directories in the store/data be migrated to a similar scheme, where  
> they don't have the
> same names as the actual dirs they're representing?

The .i extension means "index". For small amounts of data, we
interleave the index and the data together. For larger logs, we split
the data into a separate .d file.

Changing the directory naming scheme presents lots of compatibility
issues.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list