如何仅获取从svn -verbose
输出的文件 svn log -v . -r 101
------------------------------------------------------------------------
r101 | username | 2013-05-10 16:27:55 -0400 (Fri, 10 May 2013) | 1 line
Changed paths:
M /branches/1.0/ssac/codes/filename1.java
M /branches/1.0/ssac/extn/filename2.java
M /branches/1.0/ssac/extn/filename3.java
M /branches/1.0/ssac/extn/filenmae4.java
M /branches/1.0/ssac/extn/filename5.java
M /branches/1.0/vclpcc/filename6.java
Ticket-1
我厌倦了这个:
svn log -v . -r 101 | awk '/Changed paths/{ P=1; next } /Ticket-1/ {exit} P'
输出:
M /branches/1.0/ssac/codes/filename1.java
M /branches/1.0/ssac/extn/filename2.java
M /branches/1.0/ssac/extn/filename3.java
M /branches/1.0/ssac/extn/filenmae4.java
M /branches/1.0/ssac/extn/filename5.java
M /branches/1.0/vclpcc/filename6.java
有更好的方法吗?并截断“M”元数据?
预期输出:
/branches/1.0/ssac/codes/filename1.java
/branches/1.0/ssac/extn/filename2.java
/branches/1.0/ssac/extn/filename3.java
/branches/1.0/ssac/extn/filenmae4.java
/branches/1.0/ssac/extn/filename5.java
/branches/1.0/vclpcc/filename6.java
答案 0 :(得分:0)
这应该可以解决问题:
$ svn log -v . -r 101 | awk '$1~/^[AMD]$/{for(i=2;i<=NF;i++)print $i}'
/branches/1.0/ssac/codes/filename1.java
/branches/1.0/ssac/extn/filename2.java
/branches/1.0/ssac/extn/filename3.java
/branches/1.0/ssac/extn/filenmae4.java
/branches/1.0/ssac/extn/filename5.java
/branches/1.0/vclpcc/filename6.java
答案 1 :(得分:-2)
svn log -v | grep '^[ADMR]' | gawk {print $2}
如果我忘记了某些状态,可以将它们添加到grep-string