Help. I've screwed up my repo again, and I have no idea how.

Matt Mackall mpm at
Thu Nov 2 00:08:34 CST 2006

On Wed, Nov 01, 2006 at 10:00:39PM -0500, Rob Landley wrote:
> On Wednesday 01 November 2006 9:30 pm, Rob Landley wrote:
> > What the heck is going on?
> > 
> > A copy of my screwed up repository is at:
> >
> Looking at that, I see that "hg manifest" shows the new files I added 
> yesterday, but none of the files from before that.  If I do "hg manifest 9" 
> it shows the previous files, but "hg manifest 10" shows _only_ the new files, 
> it's lost track of all the old ones.
> Question: why does diff need -r to specify a revision, but manifest doesn't 
> understand -r?

Good question. Manifest was originally a debugging command. It ought
not show those ugly hashes by default too.

> It's like the sucker things it has two heads, despite the fact I never told it 
> to branch (I don't think I did, anyway).  "hg heads"...  Yup, somehow it 
> seems to have acquired two heads when I added files last night.  Ok, "hg 
> update" and "hg merge" and...  It says the files conflict.  Well of COURSE, 
> I've been doing work in the darn repository.  Take the new ones already!

$ hg merge
abort: 'Makefile' already exists in the working dir and differs from

This message could be more specific. The trouble here is that Makefile
is unknown, on this branch at least. Proceeding is likely to destroy
data. Fixed.

> Right, mv Makefile Makefile.bak, hg revert Makefile...  And it's not in the 
> current changeset.  Well go back and FIND it you stupid...

It's never existed on this branch so there's no back to go to.

> Sigh.  "hg 
> revert -r 9 Makefile", now:

Your history looks like this:

11                      9
 \                     /
 10   0-1-2-3-4-5-6-7-8
   \ /
So at some point, you started committing in a repo you'd never done a
checkout in. Or you deleted your .hg/dirstate file. Any idea how that

You've actually found a bug here, by the way:

changeset:   10:4d21d59f3206
user:        landley at driftwood
date:        Tue Oct 31 23:30:06 2006 -0500
summary:     Add menuconfig, plus some basic Config info, lots of

We don't report that the parent is not 9.

>   $ hg merge
>   abort: outstanding uncommitted changes

Again, we don't like to merge here because merging is potentially
destructive. Forcing a commit allows botched merges to be redone. And
it also makes the history more detailed, differentiating changes done
before and during the merge.

>   $ hg commit
>   Please choose a commit username to be recorded in the changelog via
>   command line option (-u "First Last <email at>"), in the
>   configuration files (hgrc), or by setting the EMAIL environment variable.
>   abort: No commit username specified!
>   transaction abort!
>   rollback completed
> I've been using this darn thing for WEEKS without whatever this problem is.  
> My fault upgrading to try to make what looked like a bug go away.  Ok, 
> whereis hgrc, finds a man page, says I should edit /etc/mercurial/hgrc which 
> is essentially empty, read the man page some more...

Note that the recorded username is landley at driftwood. Not very useful
for an actual distributed project. Rather than clutter project
histories with guesses, we're now making people set a name.

This should be in the readme.
> Question: Why doesn't the error message above say _HOW_ to add a commit 
> username to hgrc?  It's not obvious.  Read far enough in the man page and you 
> find it's key "username" in section "ui", except that says the default is 
> username at hostname which is apparently no longer the case.

Because some clever person decided my original terse message was not
verbose enough. Also, you have an old manpage in your path.

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial mailing list