In Subversion, list files that have changed on the trunk but not on a branch and which have changed in both
I need to know what files have changed in my Subversion trunk, that have n开发者_JAVA百科ot changed on a specific branch as well as what files have changed in both.
At present my approach is to get the list of changed files in the trunk and the branch and use a file diffing tool to see the differences.
Is there a better technique than this?
When you have access to a unix shell (or the uniq, sort and sed tools), you can do the following:
# 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
精彩评论