0

如何仅获取提交的文件作为 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
4

2 回答 2

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
于 2013-05-13T19:03:28.323 回答
-2
svn log -v | grep '^[ADMR]' | gawk {print $2}

如果我忘记了某些状态,可以将它们添加到 grep-string

于 2013-05-13T20:01:42.780 回答