how to detect modified properties using SVN log
Asked Answered
B

5

11

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 files and properties, but seems to not distinguish its verbose output between a content modification over property modifications.

Am I reading this output wrong, or is there an easy way to get a list of changed files between revisions whilst ignoring prop changes

Here's my sample cmd:

#: svn log "someurl" -r 2210:HEAD -v -q

Output:
------------------------------------------------------------------------
r2211 | author | 2010-02-08 12:36:56 +1300 (Mon, 08 Feb 2010)
Changed paths:
   M /branches/project/release-v1-r-maintenance
   M /branches/project/release-v1-r-maintenance/offroot/
   M /branches/project/release-v1-r-maintenance/offroot/test.config
------------------------------------------------------------------------

The top two are only prop changes (mergeinfo, ignores, etc), whereas the 3rd item is an actual content edit and this is the real item that I want to grab to avoid exporting whole root all over.

Is there anyway to get/filter out just the content changes from the svn log or other command.

Brost answered 8/2, 2010 at 23:56 Comment(0)
M
3

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.

Misery answered 18/8, 2010 at 3:2 Comment(0)
S
4

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
Stinkwood answered 1/2, 2011 at 11:18 Comment(2)
This is very useful, however it doesn't appear to work (for me). I'm using cygwin svn client and set the startrev to the revision i knew there were property changes in, and endrev to the next revision number. No output to std out and echo $? gives 0.Deciare
Oh, I seem to (unwillingly) have a different locale on my svn client. That explains why the grep doesn't find anything ^^Deciare
M
3

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.

Misery answered 18/8, 2010 at 3:2 Comment(0)
O
1

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
Othella answered 9/2, 2010 at 0:15 Comment(1)
Yeh, was sort of avoiding that answer since the output seems messy and possibly unreliable. Although this is probably the only option unless anyone else has some ideas. Assuming the 'Index: <filename>' string always appears when there's a content change, then I guess there's some scope for parsing. Hmm, thanks for the input.Brost
D
1

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

Deciare answered 1/4, 2011 at 9:0 Comment(0)
T
0

Does this work?

svn log --xml --with-no-revprops
Tortoiseshell answered 9/2, 2010 at 0:8 Comment(2)
My svn server is version 1.5.1 and --with-no-revprops is not available on svn-log cmd. Is this a newer feature? Time to upgrade my repo?Brost
@Dan: yes, it's a new feature in 1.6Othella

© 2022 - 2024 — McMap. All rights reserved.