Subversion:如何查找未合并到主干的所有修订? [英] Subversion: howto find all revisions that are not merged to trunk?

查看:91
本文介绍了Subversion:如何查找未合并到主干的所有修订?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为发布周期分配源是常见的源管理方案之一.尽快合并是一个好习惯.因此,我们有一个人为因素:分支是封闭的,但是有人忘记将某些东西合并回主干.

Branching sources for release cycle is one of common source management scenarios. Merging as soon as possible is a good practice. Thus we have a human factor: branch is closed, but someone forgot to merge something back to trunk.

问:是否可以通过一键式"方式将所有未从分支X合并到主干的修订号?

Q: Is there a "one click" way to get all revision numbers that were not merged from branch X to trunk?

(注意:我不需要这些修订号来查找要合并的内容,我需要它们来创建自动验证,这将提醒人们确保他们不要忘记将某些内容合并到主干中.合并本身不是问题)

(Note: I do not need these revision numbers to find what to merge, I need them to create automated validation, that would remind people to make sure they did not forget to merge something to trunk. Merging itself is not an issue.)

似乎svn mergeinfo命令无法在这里提供帮助.如果合并不是在根级别执行的,则传递分支和主干根将失败(这是常见的情况).

It seems like svn mergeinfo command fails to help here. Passing branch and trunk roots will fail if merge was performed not on root level (and it is a common scenario).

欢迎使用脚本,任何类型的svn挂钩工具作为解决方案.

Scripts, tools any kind of svn hooks as a solution are welcome.

P.S.

最新版本的SVN.无需争论这种情况有多普遍或好;)

Latest version of SVN. No need to argue how common or good this scenario is ;)

推荐答案

简短的回答:我不这么认为.

Short answer: I don't think so.

长答案:我最终写了一个python脚本来回答这个问题. 每当开发人员合并变更集时,他们都需要在日志消息中放入"merged rXXX". (此脚本来自svn:mergeinfo之前的内容)该脚本解析所有活动的svn分支+主干,并递归扫描所有合并"的链接,并输出每个开发人员尚未合并的更改列表.

Long answer: I ended up writing a python script to answer this question. Whenever developers merge a changeset they're required to put "merged rXXX" in the log message. (This from before svn:mergeinfo existed) The script parses all live svn branches + trunk and recursively scans all "merged" links, outputting a per-developer list of changes they haven't merged.

[更新] @tmont的答案现在更好了,因为每个人都有一个svn版本,该版本在您只想记录逻辑修订的时候支持svn mergeinfo --show-revs eligiblesvn merge --record-only.

[update] The answer from @tmont is better now that everyone has a svn version that supports svn mergeinfo --show-revs eligible and svn merge --record-only for those times when you want to record the logical fix only.

这篇关于Subversion:如何查找未合并到主干的所有修订?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆