how to detect modified properties using SVN log

大城市里の小女人 提交于 2019-12-01 03:07:52
LarsH

FYI, I posted a bash script over at How to make ‘svn log’ ignore property changes? that implements what jeroenh was alluding to... processing the output of svn log to drive svn diff and filtering on the output of the latter.

Ingo Fischer

Here is a script i just wrote to get a verbose log of all revisions in which property changes inside the current svn dir where done. Just place the right start and end version where you guess the propertychange happened. It's not very fast, but it works.

#!/bin/bash
# Show the verbose log of the revisions, where svn properties 
# inside the current folder where added/removed
startrev=4600
endrev=4620
for i in $(eval echo {$startrev..$endrev})
  do
    svn diff -c $i 2>/dev/null | grep "Property changes on" 1>/dev/null
    if [ $? == 0 ]; then
      echo "Property change in revision $i:"
      svn log -r $i --verbose
    fi
done

I think the only way is to actually parse the diff output for each revistion, though that seems rather brittle, and probably very slow...

This is how a diff entry looks for a file with only changed properties:

c:\test\wc>svn diff -c 3

Property changes on: test.txt
___________________________________________________________________
Added: test
   + test

This is how a diff entry looks for a file with changed contents AND changed properties:

c:\test\wc>svn diff -c 4
Index: test.txt
===================================================================
--- test.txt    (revision 3)
+++ test.txt    (revision 4)
@@ -1 +1,2 @@

+asdfads

Property changes on: test.txt
___________________________________________________________________
Added: someproperty
   + somepropertyvalue

I know this question has been answered, but in case anyone would like a little guide I've made this post about how to get get queryable data from svn log/diff (including bash scripts, xslt and oracle database scripts). Doing this enables you to run all sorts of useful queries against the view v_svnlog

"hot" files in this patch:

select path, count(*) num from v_svnlog
group by path
order by num desc, path asc

most tests by author

select author, count(*) num from v_svnlog
where path like '%Test%'
group by author
order by num desc

and so on...

Does this work?

svn log --xml --with-no-revprops
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!