Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Create a diff for lots of revisions

Tags:

branch

diff

svn

I had a private branch that I did a ton of commits to, then I merged it into trunk, and did a few little tweaks there.

Now the trunk maintainer wants a diff off all of my changes incase we need a rollback.

How can I create this? If you need numbers for your examples, assume that

224446

was my main revision where I merged into trunk,

224453 and 224462

were my minor fixes, and I have countless changes when in my private branch.

like image 769
Paul Tarjan Avatar asked Oct 13 '09 06:10

Paul Tarjan


People also ask

How to take svn diff between two revisions?

Display the differences between two paths. The ways you can use svn diff are: Use just svn diff'to display local modifications in a working copy. Display the changes made to TARGET s as they are seen in REV between two revisions.

How do I compare svn versions?

Pick the two revisions you want to compare then use Context Menu → Compare Revisions. If you want to compare the same item in two different trees, for example the trunk and a branch, you can use the repository browser to open up both trees, select the file in both places, then use Context Menu → Compare Revisions.

How do I compare two svn branches?

Discover the revision numbers: You need to know the revision numbers of the latest versions in each of the branches. It looks like svn log is the only way to do that. cd into one of the branch directories, such as trunk. Supply the revision numbers to the svn diff command: svn diff -r123:145.

How do I view a specific revision in svn?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.


1 Answers

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)
like image 154
Martin v. Löwis Avatar answered Oct 11 '22 17:10

Martin v. Löwis