Quantcast
Channel: Planet Ubuntu
Viewing all articles
Browse latest Browse all 17727

Alexander Sack: I am sure I don't get mercurial's (hg) branches and heads concept...

$
0
0

I am sure I am moronic, but …

hg clone http://dev.mutt.org/hg/mutt
destination directory: mutt
requesting all changes
adding changesets
adding manifests
adding file changes
added 6202 changesets with 17611 changes to 532 files (+8 heads)
updating to branch default
369 files updated, 0 files merged, 0 files removed, 0 files unresolved

gives me a fresh copy claiming that it updated the ‘default’ branch.

Now…

asac@thinki:/tmp/test$ cd mutt/
asac@thinki:/tmp/test/mutt$ hg branch
default

confirms that somewhat, but…

asac@thinki:/tmp/test/mutt$ hg log -l1
changeset:   6201:c26dbc7021f4
branch:      HEAD
tag:         tip
user:        TAKAHASHI Tamotsu
date:        Tue Dec 20 22:24:35 2011 -0800
summary:     Updated Japanese translation

already seems to think its the HEAD branch and…

asac@thinki:/tmp/test/mutt$ hg branches
HEAD                        6201:c26dbc7021f4
mutt-1-4-stable             5160:9c9fbf98fbda
mutt-1-4-stable-NEW_NOICONV 2871:2946ce6c56c9
mutt-1-2-5-1                1839:1da8b126c870
mutt-1-0-stable             1203:982532ae8410
mutt-0-95-exp                682:90944f375844
mutt-0-94                    411:a60586461eb8
mutt-0-93                    146:6934de2f9f48
muttintl                       2:5b142858393a
default                     5034:f467353f5657 (inactive)
mutt-1-2-stable             1835:8b0b9f06f1ba (inactive)

tells me the default branch is a) inactive and b) a different revision.

I feel that ‘default’ is probably something like a magic label referring to a somehow configured default branch in the repository (e.g. HEAD in this case), but then I couldn’t figure a) how to set which branch ‘default’ should refer to and b) what the real ‘default’ branch above is about and why I cannot get that revision checked out with ‘hg checkout -r default’.

I tried searching the hg web documentation and found confusing things like concepts of branches, heads and dragons etc. in mercurial…

So now I wonder: is hg harder than git?

If anybody knows about a crisp and clear write up on how to use hg branches/heads properly, please drop a comment. At best such intro would be targeted at the use case of maintaining a longer term running downstream repository with a regularly rebased? branch…


Viewing all articles
Browse latest Browse all 17727

Trending Articles