Cannot check in new files, history gone (using Mercurial with Netbeans)
Holger Matthies
holger.matthies at gmx.net
Fri Sep 16 22:30:02 UTC 2011
On Fri, Sep 16, 2011 at 18:17, Tony Mechelynck
<antoine.mechelynck at gmail.com> wrote:
> On 16/09/11 21:35, Matt Mackall wrote:
>>
>> On Fri, 2011-09-16 at 15:54 -0300, Holger Matthies wrote:
>>>
>>> On Fri, Sep 16, 2011 at 14:01, Matt Mackall<mpm at selenic.com> wrote:
>>>>
>>>> On Thu, 2011-09-15 at 22:57 -0300, Holger Matthies wrote:
>>>>>
>>>>> Hi Matt,
>>>>>
>>>>> That last commit can be discarded, I feel it didn't check in anything
>>>>> at all, actually. Can you tell me what I should do to correct the
>>>>> situation? That would be undoing that commit and checking out a
>>>>> revision (and hoping the GUI gets back to work afterwards).
>>>>
>>>> First run 'hg heads' to determine which commit you -ought- to have
>>>> checked out. Then run 'hg update<rev>' to update to it.
>>>
>>> Hi Matt,
>>>
>>> Looking good, but I think I'm not there yet:
>>>
>>> C:\Program Files\xampp\htdocs>hg head
>>> changeset: 1652:9b992da41ac5
>>> tag: tip
>>> parent: -1:000000000000
>>> user: Holger Matthies<holger>
>>> date: Wed Aug 31 23:53:37 2011 -0300
>>> summary: Why?
>>>
>>> changeset: 1651:2db1a3e0df08
>>> parent: -1:000000000000
>>> user: Holger Matthies<holger>
>>> date: Wed Aug 10 12:29:20 2011 -0300
>>> summary: [FIX] spelling
>>
>> See that "parent: -1"?
>>
>> The -1 revision is the revision you're at when you start with a brand
>> new empty project. When you make a checkin in that state, you end up
>> with a checkin that's COMPLETELY DISCONNECTED from the history of the
>> rest of your project.
>>
>> So this is yet another instance of the "all my files went to state ?
>> somehow and I checked in anyway" problem.
>>
>>> changeset: 1650:1fc509c0fc73
>>> user: Holger Matthies<holger>
>>> date: Wed Aug 10 12:29:08 2011 -0300
>>> summary: [FIX] spelling
>>
>> This one has no parent listed, which means its parent is N-1. In other
>> words, this one is in the normal chain of history. This is the one you
>> want.
>>
>>> So I thought I could update to 1651 and everything would be all right.
>>>
>>> C:\Program Files\xampp\htdocs>hg update 1651
>>> [...]
>>> 42 files updated, 8 files merged, 0 files removed, 0 files unresolved
>>>
>>> But hg heads still returns the same three results
>>
>> ..and will until you do something to remove those heads. Simply checking
>> something out doesn't remove other things from history!
>>
>> The usual way to do this is to use:
>>
>> hg clone -r 1650 messed-up-repo clean-repo
>
> ...then edit the .hg/hgrc in the clean-repo so that the "default" entry in
> its [paths] section points to wherever you want to pull from when you do,
> not to the corrupt messed-up-repo (if you leave it pointing to the messed-up
> repo, it will pull the spurious heads the next time you pull).
>
>>
>>> and hg status still
>>> returns all files unchecked. Do I need to do something else? Would it
>>> be correct to have only one head? How do I get rid of the other one?
>>>
>>> Thanks,
>>> Holger
>
>
> Best regards,
> Tony.
Tony and Matt, thanks for your input. I've done this and think I
understand the logic behind that, but have one (hopefully last)
question. Creating the clean-repo has created a new repository inside
a subfolder, in this case "C:\Program Files\xampp\htdocs\clean-repo",
containing every file that was in the corrupt repository. For my
programming and testing purposes I don't want the directories to
change. I'd like to get rid of the old repository (without losing my
history etc.) and use \htdocs as the root folder as I did before. Now
that I've created the clean-repo, can I (and if so, how?) remove the
corrupted one and move the clean-repo one folder up, dropping the
"clean repo" name? So that everything goes back to normal.
Thanks once more and best regards,
Holger
More information about the Mercurial
mailing list