我在Mercurial回购中有两个分支和两个负责人:正常还是坏?

时间:2013-04-29 04:56:19

标签: mercurial

我的回购有两个分支:默认和稳定。我可能搞砸了某个地方。我看到两个脑袋。这是正常的吗?

以下是负责人:

changeset:   10:b4131c44f968
branch:      stable
tag:         tip
parent:      8:f06486c8c9f1
parent:      9:135102b0cb32
user:        nobody nobody <nobody@nobody.org>
date:        Mon Apr 29 00:08:57 2013 -0400
summary:     Merged with development on #2

changeset:   9:135102b0cb32
parent:      7:cf9ae7e052dd
parent:      8:f06486c8c9f1
user:        nobody nobody <nobody@nobody.org>
date:        Mon Apr 29 00:08:20 2013 -0400
summary:     BUG: Working on #2 gallery width/height not set.

这是graphlog。

nobody@nobody:~/hg/project-js-backup$ hg log -G
o    changeset:   10:b4131c44f968
|\   branch:      stable
| |  tag:         tip
| |  parent:      8:f06486c8c9f1
| |  parent:      9:135102b0cb32
| |  user:        nobody nobody <nobody@nobody.org>
| |  date:        Mon Apr 29 00:08:57 2013 -0400
| |  summary:     Merged with development on #2
| |
| @  changeset:   9:135102b0cb32
|/|  parent:      7:cf9ae7e052dd
| |  parent:      8:f06486c8c9f1
| |  user:        nobody nobody <nobody@nobody.org>
| |  date:        Mon Apr 29 00:08:20 2013 -0400
| |  summary:     BUG: Working on #2 gallery width/height not set.
| |
o |  changeset:   8:f06486c8c9f1
|\|  branch:      stable
| |  parent:      6:c8a92230bc6c
| |  parent:      7:cf9ae7e052dd
| |  user:        nobody nobody <nobody@nobody.org>
| |  date:        Sun Apr 28 23:14:37 2013 -0400
| |  summary:     Merged with devleopment branch. Fixed #1 data reporting double /beta in url.
| |
| o  changeset:   7:cf9ae7e052dd
| |  parent:      5:7582497d8a1b
| |  user:        nobody nobody <nobody@nobody.org>
| |  date:        Sun Apr 28 23:09:11 2013 -0400
| |  summary:     BUG: Fixed issue #1.
| |
o |  changeset:   6:c8a92230bc6c
|/   branch:      stable
|    user:        nobody nobody <nobody@nobody.org>
|    date:        Tue Apr 23 13:26:23 2013 -0400
|    summary:     Created branch stable
|
o  changeset:   5:7582497d8a1b
|  user:        nobody <nobody@nobody.org>
|  date:        Mon Apr 22 17:54:43 2013 -0300
|  summary:     Fixed result should return 200 not 201.
|
o  changeset:   4:69ddb4892fc7
|  user:        nobody <nobody@nobody.org>
|  date:        Mon Apr 22 17:49:50 2013 -0300
|  summary:     Fixed response.status on line 272.
|
o  changeset:   3:b029e0a90db8
|  user:        nobody <nobody@nobody.org>
|  date:        Mon Apr 22 17:48:18 2013 -0300
|  summary:     get rid of response_ok check in other functions.
|
o  changeset:   2:9dbccc12d211
|  user:        nobody <nobody@nobody.org>
|  date:        Mon Apr 22 17:28:01 2013 -0300
|  summary:     get rid of response_ok check in postCreateResult
|
o  changeset:   1:517b642f7785
|  user:        nobody nobody <nobody@nobody.org>
|  date:        Mon Apr 22 16:05:53 2013 -0400
|  summary:     Initialized ged.js
|
o  changeset:   0:b7eb08ae529a
   user:        nobody <nobody@nobody.org>
   date:        Mon Apr 22 13:04:36 2013 -0700
   summary:     Initial commit

如果我需要合并,我尝试将它们与(基于此http://kiln.stackexchange.com/questions/1696/how-to-fix-multiple-heads/1698#1698

组合在一起
hg up -C -r 10
hg merge -r 9

但我得到abort: merging with a working directory ancestor has no effect

主意?

1 个答案:

答案 0 :(得分:1)

使用两个分支时,这是完全正常的。每个分支只有一个头,这意味着没有什么可以合并。使用

$ hg heads default
$ hg heads stable

仔细检查一下。您还会注意到hg merge报告没有任何内容可以合并:它只会在您当前的分支上寻找第二个头。

使用两个分支允许您将存储库中的更改集分为两组:稳定组和默认组。您在stable分支上进行错误修正(从而创建更稳定的更改集)。然后,将stable合并到default,将错误修正传播回主要开发所在的default分支。有关详细信息,请参阅Mercurial's wiki。我的guide to named branches也可能有用。