开发者

Understanding Mercurial Branching

I'm learning mercurial and I went to commit some changes and I got the message along the lines of "new head created" -- though I could have sworn that I did an hg pull and an hg update prior to doing new work.

I then got confused so I did a merge to try to get out of the mess. The single file I'm working on is fine (again I'm using only one file as I try to learn HG). I can't post my image (not enough points) but I tried to recreate it below.

When I created the tag seo_v_1.0 did I automatically create a branch? In other hg repos I simply create a tag, push the changes and keep going.

Can someone help me decipher what I did here? The only change I made on the repo before the merge thing was that I committed the "up to 33" changset. So maybe -- according to my branch diagram here below -- I was already in the branch but didn't know it? Did the creation of tag seo_v_1.0 inadvertently create a branch?

Thanks in advance.

Note that the line out starts from "seo_v_1.0" to "added tag.." and the line comes back in at "up to 33" to "default tip merge thing"

  • default tip merge thing [this is in yellow] [and default is in green]
    • up to 33
    • added tag seo_v_1.1 for changeset xxxx
    • seo_v1.1 cleared colors [this is in 开发者_运维技巧yellow]
    • added tag seo_v_1.0 for changeset xxxx
  • seo_v_1.0-completed [this is in yellow]
  • seo through section 2
  • seo cross reference done
  • initial commit

Edit: glog output added

@ changeset: 9:8637aa6d738f 
|\ tag: tip 
| | parent: 8: 
| | parent: 7: 
| | 
| | summary: merge thing 
| | 
| o changeset: 8: 
| | parent: 4: 
| | 
| | summary: up to 33 
| | 
o | changeset: 7: 
| | 
| | summary: Added tag seo_v_1.1 for changeset de5f8c81840f 
| | 
o | changeset: 6: 
| | tag: seo_v_1.1 
| | 
| | 
| | summary: cleared left col colors 
| | 
o | changeset: 5: 
|/ 
| 
| summary: Added tag seo_v_1.0 for changeset c13bd5d3cc09 
| o changeset: 4: 
| tag: seo_v_1.0 
| 
| summary: -completed cross-reference


Can you show us the output of "hg glog" with the graphlog extension enabled?

hg --config extensions.graphlog="" glog

You can strip most of the changes, but please leave at least enough changes to show:

  • The tag operation
  • The merge you did


Creating a tag definitely didn't create a named branch, but it could have created an anonymous branch, because the act modifies the .hgtags file and then commits.

Give this a quick read; it's immensely helpful:

http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/

I'm sure with the hg glog output Giorgos requested we can help you figure out what happened, but with a little more understanding from that guide you'll probably see it yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜