[英]How to visually compare two revisions of a folder versioned by SVN on Linux?
I can compare a current folder state to its latest revision using the following command:我可以使用以下命令将当前文件夹 state 与其最新版本进行比较:
meld .
meld
shows a list of changed files. meld
显示已更改文件的列表。 One can click on each file and see a diff.可以单击每个文件并查看差异。
Is it possible to compare a current folder state to its specific revision (not the latest one)?是否可以将当前文件夹 state 与其特定版本(不是最新版本)进行比较?
TortoiseSVN allows to compare arbitrary revisions, however it works on Windows only. TortoiseSVN 允许比较任意版本,但它仅适用于 Windows。 SmartSVN is proprietary.
SmartSVN 是专有的。 SVN CLI is unusable for big changesets (CLI diff is fine for small commits, but it's very hard to use it for branch comparision with a lot of changes).
SVN CLI 不适用于大的变更集(CLI diff 对于小提交很好,但是很难将它用于具有大量更改的分支比较)。
Maybe I could checkout the revision to compare into a separate folder and compare two folders using meld
.也许我可以检查修订以比较到一个单独的文件夹并使用
meld
比较两个文件夹。 But I guess there should be a simpler approach.但我想应该有一个更简单的方法。
Preface前言
Question is offtopic here: as already mentioned in comment, it's question for Software Recommendations site问题在这里是题外话:正如评论中已经提到的,这是软件推荐网站的问题
Face脸
According to Slant's comparison :根据Slant 的比较:
From points 1-3 above it follows that Meld can be used for your task in form从上面的第 1-3 点可以看出,Meld 可以用于您的任务
meld folder@REV1 folder@REV2
Folder comparision is usually required for code review or branch merging.代码审查或分支合并通常需要文件夹比较。 It seems that the simplest approach is as follows:
似乎最简单的方法如下:
I didn't found any existing tools supporting it.我没有找到任何支持它的现有工具。 Here is a simple bash script:
这是一个简单的 bash 脚本:
TRUNK_FOLDER=~/tmp/trunk-merge
LAST_TRUNK_MERGED_REV=$(svn mergeinfo --show-revs merged -R "^/trunk" | tail -n 1)
if [[ -z "$LAST_TRUNK_MERGED_REV" ]]; then
LAST_TRUNK_MERGED_REV=$(svn log -r 1:HEAD --limit 1 --stop-on-copy -q | grep -oP "^r\K[0-9]+")
echo "The branch was copied from trunk@$LAST_TRUNK_MERGED_REV"
else
echo "The branch was last merged from trunk@$LAST_TRUNK_MERGED_REV"
fi
svn update -r $LAST_TRUNK_MERGED_REV "$TRUNK_FOLDER"
meld "$TRUNK_FOLDER" .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.