合并命名分支上的变更日志,但不是未合并的

发布于 2024-10-08 23:08:42 字数 1762 浏览 0 评论 0原文

我希望能够获得出现在图表中的每个变更集的“hg log” 变更集 1 和变更集 2。我无法找到一种方法来做到这一点,没有任何一个 a) 省略在changeset1:changset2之间合并的命名分支上的节点 或者 b) 包括命名分支上不是changeset2祖先的节点

这是一个简单示例的“hg glog”,其中包含2个命名分支加上默认分支。一个命名分支被合并,因此它的节点是相关的,另一个是不相关的:

@    changeset:   5:e384fe418e9b
|\   tag:         tip
| |  parent:      2:7dc7af503071
| |  parent:      3:0a9be59d576e
| |  summary:     merge somefeature branch into default
| |
| | o  changeset:   4:4e8c9ca127c9
| | |  branch:      unmerged_feature
| | |  parent:      1:ef98ad136fa8
| | |  summary:     change that is not merged into ending changeset
| | |
| o |  changeset:   3:0a9be59d576e
| |/   branch:      somefeature
| |    parent:      1:ef98ad136fa8
| |    summary:     changed b.txt
| |
o |  changeset:   2:7dc7af503071
|    summary:     changed a.txt
|
o  changeset:   1:ef98ad136fa8
|  summary:     added b.txt
|
o  changeset:   0:271b22b4ad30
   summary:     added a.txt

我想要一个日志命令,它将为我提供 rev 0 的后代和 rev 5 的祖先的所有节点。这是除 rev 4 之外的所有节点。

我可以获取太多信息:

hg log -r 0:5 --template "{rev}:branch={branches},desc={desc}\n"

这为我提供了 rev 4 的日志条目,它不是 rev 5 的祖先:

0:branch=,desc=added a.txt
1:branch=,desc=added b.txt
2:branch=,desc=changed a.txt
3:branch=somefeature,desc=changed b.txt
4:branch=unmerged_feature,desc=change that is not merged into ending changeset
5:branch=,desc=merge somefeature branch into default

我可以获得的信息太少:

hg log -b default -r 0:5 --template "{rev}:branch={branches},desc={desc}\n"

省略 rev 3,它是 rev 0 的后代和 rev 5 的祖先

0:branch=,desc=added a.txt
1:branch=,desc=added b.txt
2:branch=,desc=changed a.txt
5:branch=,desc=merge somefeature branch into default

I want to be able to get a "hg log" of every changeset that appears in the graph between
changeset1 and changeset2. I cannot find a way to do it without either
a) omitting nodes on named branches that ARE merged between changeset1:changset2
or b) including nodes on named branches that ARE NOT ancestors of changeset2

Here's a "hg glog" of a simple example with 2 named branches plus the default branch. One named branch gets merged and so its nodes are relevant, the other is irrelevant:

@    changeset:   5:e384fe418e9b
|\   tag:         tip
| |  parent:      2:7dc7af503071
| |  parent:      3:0a9be59d576e
| |  summary:     merge somefeature branch into default
| |
| | o  changeset:   4:4e8c9ca127c9
| | |  branch:      unmerged_feature
| | |  parent:      1:ef98ad136fa8
| | |  summary:     change that is not merged into ending changeset
| | |
| o |  changeset:   3:0a9be59d576e
| |/   branch:      somefeature
| |    parent:      1:ef98ad136fa8
| |    summary:     changed b.txt
| |
o |  changeset:   2:7dc7af503071
|    summary:     changed a.txt
|
o  changeset:   1:ef98ad136fa8
|  summary:     added b.txt
|
o  changeset:   0:271b22b4ad30
   summary:     added a.txt

I want a log command that will give me all the nodes that are descendent of rev 0 and ancestors of rev 5. This is everything except rev 4.

I can get too much info:

hg log -r 0:5 --template "{rev}:branch={branches},desc={desc}\n"

This gives me a log entry for rev 4, which is not an ancestor of rev 5:

0:branch=,desc=added a.txt
1:branch=,desc=added b.txt
2:branch=,desc=changed a.txt
3:branch=somefeature,desc=changed b.txt
4:branch=unmerged_feature,desc=change that is not merged into ending changeset
5:branch=,desc=merge somefeature branch into default

I can get too little info:

hg log -b default -r 0:5 --template "{rev}:branch={branches},desc={desc}\n"

omits rev 3, which is a descendent of rev 0 and ancestor of rev 5

0:branch=,desc=added a.txt
1:branch=,desc=added b.txt
2:branch=,desc=changed a.txt
5:branch=,desc=merge somefeature branch into default

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆凄美了谁 2024-10-15 23:08:42

如果您使用的是较新版本的 Mercurial(1.6.0 或更高版本),则可以使用 revsets< /a> 功能。在这种情况下,您需要祖先()运算符:

hg log --rev ancestors(5)

请参阅 hg help revsets 了解更多信息。

If you're using a newer version of Mercurial (1.6.0 or higher), you can use the revsets feature. In this case, you need the ancestors() operator:

hg log --rev ancestors(5)

See hg help revsets for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文