在我当前的 svn 存储库中,我使用以下命令:
svn mergeinfo --show-revs eligible ^/trunk ^/branches/testing
获取修订以程序可处理的格式合并。
有人知道集市中是否有等效的命令吗?
bzr
的工作方式,我认为没有与svn mergeinfo
完全相同的等价物,但是,您查找的信息应该可以通过bzr missing
命令检索,特别是:
cd /path/to/trunk
bzr missing --line --theirs-only /path/to/branches/testing | tail + 2 | awk -F: '{print $1}'
--theirs-only
选项显示存在于其他分支中但尚未合并到当前分支中的修订。tail +2
筛选器会去除标题行。
--line
格式将包含其他信息,然后awk
仅打印冒号前的修订号来去除这些信息。
如果需要,您还可以使用 -d
选项省略自动脚本中的cd
部分:
bzr missing --line --theirs-only -d /path/to/trunk /path/to/branches/testing
如果您需要更多信息而不仅仅是修订号(例如,如果您需要 UUID 而不是数字修订号),您可以通过以下方式安装 bzr-xmloutput 插件:
# create ~/.bazaar/plugins directory if it doesn't exist via
# mkdir ~/.bazaar; mkdir ~/.bazaar/plugins
cd ~/.bazaar/plugins
bzr branch lp:bzr-xmloutput xmloutput
并使用--xml --show-ids
而不是--line
,并使用您喜欢的 XML 库来处理输出。