在Subversion中,列出已在主干上更改但未在分支上更改的文件以及两者中已更改的文件

时间:2010-12-15 09:37:16

标签: svn

我需要知道我的Subversion主干中哪些文件已更改,这些文件在特定分支上没有更改,以及两者中哪些文件已更改。

目前,我的方法是获取主干和分支中已更改文件的列表,并使用文件差异工具查看差异。

有没有比这更好的技术?

1 个答案:

答案 0 :(得分:1)

当您可以访问unix shell(或uniq,sort和sed工具)时,您可以执行以下操作:

# getting the changed file list in trunk
svn diff --summarize /path/to/repos/trunk@branch-rev /path/to/repos/trunk | sed -e 's/......//' > changes-trunk
# the sed part removes the status columns, which might cause uniq to fail identifying equal files

# getting the changed file list of the branch
svn diff --summarize /path/to/repos/trunk@branch-rev /path/to/repos/branch/foobar| sed -e 's/......//' > changes-branch
# display the files which changed on both branches
sort changes-trunk changes-branch | uniq -d > possible-conflicts

# getting the base file list
svn ls -R /path/to/repos/trunk@branch-rev > files-base
# getting the list of files not changed in trunk
sed -e "s# /path/to/repos/trunk@branch-rev/##" changes-trunk | sort - files-base | uniq -u > untouched