SVN: Create a diff for lots of revisions

One possible procedure would be to do this:

  1. create diffs for 224453 and 224462 (e.g. by svn diff -r 224452:224453 > diff1.patch).
  2. check out 224446 (svn up -r224446)
  3. apply the diffs (e.g. patch -p0 -i diff1.patch)
  4. create a diff of that against 224445 (svn diff -r 224445 > diff2.patch)

One option would be to create a branch at 224446, then merge in 224453 and 224462. Then take a diff between that and 224445 on the trunk. That should be all the changes in one, and you can create it as a patch file should you need to:

# Branch from your initial checkin
svn cp svn://xyz/trunk@224446 svn://xyz/branches/foo

# Check it out
svn checkout svn://xyz/branches/foo tmp

# Merge in the two changes
svn merge -c 224453,224462 svn://xyz/trunk tmp

# Commit the changes
svn commit tmp -m "Extra commits 224453 and 224462"

# Diff the branch from mainline before original
svn diff svn://xyz/trunk@224445 svn://xyz/branches/foo

This is largely the same as Martin's answer, just with different ways of applying the changes and getting the diffs. Note that although in this case I've committed the changes, you don't really have to - you could just do svn diff svn://xyz/trunk@224445 tmp instead of the last two commands. The nice thing about having it in the repository is then anyone can apply the diff in reverse to roll it back, should that be required.

Tags:

Svn

Branch

Diff