screwed up repo, I have no clue how I did it & how to solve it

Becker, Mischa J mischa.becker at fredmeyer.com
Wed Jan 30 19:56:43 UTC 2013


> -----Original Message-----
> From: mercurial-bounces at selenic.com [mailto:mercurial-
> bounces at selenic.com] On Behalf Of roland schmitz
> Sent: Wednesday, January 30, 2013 12:22 AM
> To: mercurial at selenic.com
> Subject: Re: RE: screwed up repo, i have no clue how i did it & how to
> solve it
>
> Hi Mischa, hi *,
>
> > Either the output was abridged, or tip is a closed head. I was
> > assuming the former but rereading the original email makes me think
> it
> > is probably the latter.  Push doesn't care if the head is open or
> > closed, it just cares if it is going to push another head.
> >
> > It looks to me like he closed all of his extra heads but since they
> > weren't merged into the open head, they still exist as heads and
> > therefore push is complaining.
>
> is there a way to merge "everything" that way, that the code i have
> actually in my repo/on my disk will be the one which lasts? This would
> be my first merge ever ;-}
>

Depends on what you mean by "everything".  If you have 5 heads, it will take 4 merges to get back down to only 1 head. :-)

I use TortoiseHg. With that, merging is as easy as updating to the revision I want to keep; right-clicking on the revision I want to merge and selecting 'Merge with Local'.  To throw away everything in the other rev, click the plus next to Options and check 'Discard all changes from merge target (other) revision'.

To merge and throw away changes from a closed head on the command line, I think it would be something like this:
hg up -r [rev to keep]
hg merge -r [head to get rid of]
hg revert -r [rev to keep]
hg resolve -a -m        //this is only needed if the merge leaves files unresolved.
hg ci -m "discarding closed head"

If you are working from the command line, I really recommend enabling the graphlog extension.  Looking at a graphical representation of your repo can be *very* helpful for figuring out what is going on/why you are ending up with extra heads.

Mischa

> Yes, I'm the only user of this repo.
>
> Yours
>
> Roland
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial

________________________________

This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.



More information about the Mercurial mailing list