我已检出SVN存储库的子文件夹。我想编写svn diff -r$OLDESTREVISION > diff && vim diff && rm diff
脚本,以便将其别名为difforig
。
OLDESTREVISION
会有所不同,所以我不能只对它进行硬编码。我可以svn log
并解析最旧列的输出,但这需要输入密码,并且需要的时间比我想要的更长。
svn help diff
返回
-r [--revision] ARG : ARG (some commands also take ARG1:ARG2 range)
A revision argument can be one of:
NUMBER revision number
'{' DATE '}' revision at start of the date
'HEAD' latest in repository
'BASE' base rev of item's working copy
'COMMITTED' last commit at or before BASE
'PREV' revision just before COMMITTED
但svn diff -rBASE
无效。
答案 0 :(得分:1)
如果你想区分第一个和最新版本的文件,你可以使用像ag或grep这样的东西来提取第一个修订版号并动态构建一系列文件的差异:
svn diff -"$(svn log -r 1:HEAD --limit 1 ./gnu_regex/regex.c | ag -o 'r[0-9]+'):HEAD" ./gnu_regex/regex.c