Argh!!!

Phillip Neiswanger sigsegv at prodigy.net
Wed Mar 14 07:04:33 UTC 2007


Hi,

I'm now getting the following when I try to use mercurial.

prompt> hg status
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial at selenic.com
** Mercurial Distributed SCM (version 0.9.3)
Traceback (most recent call last):
   File "/usr/local/bin/hg", line 12, in ?
     commands.run()
   File "/usr/local/lib/python2.4/site-packages/mercurial/commands.py",  
line 3000, in run
     sys.exit(dispatch(sys.argv[1:]))
   File "/usr/local/lib/python2.4/site-packages/mercurial/commands.py",  
line 3172, in dispatch
     repo = hg.repository(u, path=path)
   File "/usr/local/lib/python2.4/site-packages/mercurial/hg.py", line 56,  
in repository
     repo = _lookup(path).instance(ui, path, create)
   File "/usr/local/lib/python2.4/site-packages/mercurial/localrepo.py",  
line 1968, in instance
     return localrepository(ui, util.drop_scheme('file', path), create)
   File "/usr/local/lib/python2.4/site-packages/mercurial/localrepo.py",  
line 103, in __init__
     self.manifest = manifest.manifest(self.sopener, v)
   File "/usr/local/lib/python2.4/site-packages/mercurial/manifest.py",  
line 44, in __init__
     defversion)
   File "/usr/local/lib/python2.4/site-packages/mercurial/revlog.py", line  
327, in __init__
     self.load()
   File "/usr/local/lib/python2.4/site-packages/mercurial/revlog.py", line  
383, in load
     self.parseindex(f, st)
   File "/usr/local/lib/python2.4/site-packages/mercurial/revlog.py", line  
423, in parseindex
     e = struct.unpack(self.indexformat, cur)
struct.error: unpack str size does not match format

It's my fault this is happening.  This is what I did to cause it.  I  
logged into my system and did some work on my project and commited.  At  
some point I needed do some work as root, so I su'd to root.  I finished  
the work and continued with work on my project without logging out as  
root.  I added a couple of files, and started a commit when I realized I  
was working as root.  I decided I didn't want the commit to proceed as  
root, so I killed the python process and that killed the shell of vi and  
vi itself.  I logged out as root and tried to commit and got the following  
error.

prompt> hg commit
abort: Permission denied:  
/usr/home/pgn/projects/my_project/.hg/journal.dirstate

I don't know why I didn't su back to root and try a commit, but I didn't.   
I su'd to root and performed a rollback as follows:

prompt> hg rollback
rolling back last transaction

prompt> hg status
M app/views/some_view/_partial_01.rhtml
? app/views/some_view/_partial_02.rhtml
? public/stylesheets/view.css

The rollback has not only un-added the files, but rollback the last  
commit.  I moved the 2 now un-added files out of my project and get this  
 from status.

prompt> hg status
M app/views/some_view/_partial_01.rhtml

I log out as root and try to commit again.  Nope, same error as before.  I  
then su back to root and run the recover command.

prompt> hg recover
rolling back interrupted transaction
checking changesets
checking manifests
manifest index contains 19 extra bytes
bad manifest link (-1) at revision 124
bad manifest link (-1) at revision 125
duplicate manifest at revision 125
crosschecking files in changesets and manifests
checking files
221 files, 124 changesets, 504 total revisions
4 integrity errors encountered!

prompt> hg status
M app/views/some_view/_partial_01.rhtml

I commit as root and the commit appears to work just fine.  By that I mean  
it didn't report any errors or die while trying to commit.  However, any  
command that tries to work with the repository will produce the error you  
see at the beginning of this message.  Is there anything that can be done  
with the repository at this point?  I'm of the opinion I should just  
delete the .hg directory and init/add/commit again.  I don't want to loose  
all the history, but I can at least continue if there's nothing that can  
be done to reclaim the history.
--
phil




More information about the Mercurial mailing list