Mercurial:查看分支与默认分支合并的频率
假设我有两个分支,default 和 mybranch,我想编写一个小脚本来查看:
- mybranch 与 default 合并的频率(更改从 mybranch 到 default)
- mybranch 从 default 合并的频率(更改从 default 变为默认) mybranch)
#1 的一些伪代码:
m_lastmergetime = 0
for each m in [all merges with default from mybranch]
m_mergetime = m.date_in_hours
m_timebetweenmerges = m_mergetime - m_lastmergetime
if m_lastmergetime > 0
print m_timebetweenmerges
Sub.steps:
- 一个 Mercurial 查询,它与 mybranch 中的默认值匹配所有合并
- Mercurial 的样式,显示以小时为单位的日期
- 计算合并之间的时间,如上面所示使用 Bash 或 Python 的伪代码
案例 #2 非常相似。我只需要:
- 一个 Mercurial 查询,它与默认情况下与 mybranch 的所有合并相匹配
Let´s say I have two branches, default and mybranch, I would like to write a small script to see:
- How often mybranch merges with default (changes goes from mybranch to default)
- How often mybranch merges from default (changes goes from default into mybranch)
Some pseudocode for #1:
m_lastmergetime = 0
for each m in [all merges with default from mybranch]
m_mergetime = m.date_in_hours
m_timebetweenmerges = m_mergetime - m_lastmergetime
if m_lastmergetime > 0
print m_timebetweenmerges
Sub.steps:
- A Mercurial query which matches all merges with default from mybranch
- A style for Mercurial which shows the date in hours
- Calculate the time between merges as in the above pseudocode using Bash or Python
Case #2 will be pretty similar. I only need:
- A Mercurial query which matches all merges with mybranch from default
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要查找分支 X 上从分支 Y 合并的所有变更集,您可以发出以下 Mercurial 命令:
要查找分支 Y 上从分支 X 合并的所有内容(即相反方向),只需更改最后一个分支名称Y:
基本上,查询表示您希望所有变更集:
To find all the changesets on branch X that was merged in from branch Y you would issue the following Mercurial command:
To find everything on branch Y that was merged in from branch X (ie. the opposite direction), simply change the last branch name there to Y:
Basically the query says that you want all changesets that: