I have a Mercurial repository that is in a strange state now. This is what it looks like in TortoiseHG:
Another way to see this is if you did hg update null
after committing rev. 53. For example, consider this sequence:
hg init foo
# create some files
hg addremove
hg commit -m "Revision 0"
# edit, edit, edit
hg commit -m "Revision 1"
hg update null
hg tag -m "Create tag v1.0.0.0" "v1.0.0.0"
At this point, hg log
will show revision 2's parent as -1:0000000000. Since hg update null
clears out the working directory, the only file in it would be .hgtags
(just like you were seeing).
Did you have other tags prior to rev. 53? If my suspicion is correct, they would not be present in your rev. 54 .hgtags
.
When you look at the definition of a changeset, you see:
Each changeset has zero, one or two parent changesets:
- It has two parent changesets, if the commit was a merge.
- It has no parent, if the changeset is a root in the repository.
There may be multiple roots in a repository (normally, there is only one), each representing the start of a branch."Updating" back to a changeset which already has a child, changing files and then committing creates a new child changeset, thus starting a new branch. Branches can be named.
So maybe this is what you did:
or:
Ry4an (an actual Mercurial specialist ;) ) chimes in and comments:
--close-branch
doesn't do anything except hide a branch from a list, and it's undone next time you commit on that branch. It won't create multiple roots.VonC is right in his diagnosis, multiple heads.
But no combination of 'update
' and 'commit
' will get you into that state.
To end up with multiple roots one usually has done a 'hg pull
' from repo and used--force
to override an "unrelated repositories
" warning.
("no parent", meaning the parent ids are set to 00000, see "behind the scene":
(source: red-bean.com)
)