how to detect modified properties using SVN log

后端 未结 5 398
旧时难觅i
旧时难觅i 2021-01-11 16:40

Background: writing an automated release script to export changed files between versions from SVN and upload to remote server.

The svn log command shows modified fil

相关标签:
5条回答
  • 2021-01-11 16:44

    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...

    0 讨论(0)
  • 2021-01-11 17:01

    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
    
    0 讨论(0)
  • 2021-01-11 17:03

    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.

    0 讨论(0)
  • 2021-01-11 17:03

    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
    
    0 讨论(0)
  • 2021-01-11 17:07

    Does this work?

    svn log --xml --with-no-revprops
    
    0 讨论(0)
提交回复
热议问题