0

I would like to create a patch from a range of revisions by author

my current command line is this:

svn diff -rFIRSTREVISION:LATESTREVISION pathOfWorkingCopy > /myPatchFile.patch

is there anyway that i can specify also the author who made those changes?

jorgevasquezang
  • 1,008
  • 1
  • 9
  • 16

3 Answers3

1

Short answer: No, not with the standard command line.

However, it should be easy enough to find the revisions of the author using the svn log -q. This will only list the revision line which includes the author. You can combine this with awk to find the author lines, and then pull off the revisions.

From there, you can use -c to find the diff in that revision:

$ svn log -q \
    | awk -v author=$author -F '|' '$0 ~ /^r/ && $2 = " "author" "  {           
          print substr ($1, 2)
      }' | while read rev
           do
               svn diff -c$rev
           done

The awk -v author=$author allows you to set the Awk variable author with the real author's name. The $0 ~ /^r/ && $2 = " "author" " says that lines must begin with r (skipping the lines that contain nothing but dashes), and the second field must be the author surrounded by a space on each side. This pulls up the lines the author is responsible for.

Finally, the print substr ($1,2) prints out the revision without the r in front.

I pipe this through a while read loop to do a svn diff -c$rev for all the revisions.

David W.
  • 105,218
  • 39
  • 216
  • 337
0

Each revision has only one author, so you just need to identify the revisions made by the author whose changes you want to diff.

You will need to do this in stages if other authors have made changes to the same path(s) interleaved with this particular author (identify the revisions authored by the person you're looking for, then perform a diff for each revision/block of revisions).

alroc
  • 27,574
  • 6
  • 51
  • 97
0

Starting in Subversion 1.8 you can use the --search command to find all the commits made by a certain user.

Search syntax : --search

svn log --search usernam e -l 50

You would then need to parse the commits and do a diff for each one.

If you are on Linux you can use bash to perform the diff's made by the user once the search is performed. Bash-linux-svn solution

Community
  • 1
  • 1
SoftwareCarpenter
  • 3,835
  • 3
  • 25
  • 37