Danra
Danra

Reputation: 9926

How to compare two SVN revisions in XCode?

Is there a way to compare all changes between two SVN revisions in XCode?

(I do know how to view compare a single file, using XCode 4's source-control view mode, and I do know how to view changes introduced in a single revision in the organizer's repositories section.)

Upvotes: 13

Views: 6761

Answers (5)

wmarbut
wmarbut

Reputation: 4685

In XCode 6, here is how you do it:

  1. Click the compare button and choose "Comparison". Button is in the top right of the XCode window.

    Xcode 6 comparison mode

  2. Choose a revision. Controls are at the bottom of the editor pane. Xcode 6 choose revision

Upvotes: 10

iDou
iDou

Reputation: 777

I don't know since when, but in the organizer's repositories section of xCode 4.4.1 there is a "view revision" button in the bottom right. If you put a revision number you will have all the changes from this version to the head of the repositories.

But you can also write "1800:1803" if you want to see the changes made in revision 1801, 1802 and 1803 (i.e. compare revision 1800 and 1803).

I think that's what you wanted.

Upvotes: 4

Gordon Dove
Gordon Dove

Reputation: 2577

You can compare two branches, if you're using branches. I found it using source control|merge and then cancelling the merge, but there might be another way.

I don't know if you can retroactively create a branch in Xcode, but if you create the branch from the command line, I'm pretty sure Xcode will recognise it.

svn copy -r specificRevisionNumber file:///Users/yourName/svn/yourProject/trunk file:///Users/yourName/yourProject/branches/yourProject-1.0

Hope that helps

Upvotes: 0

Dan J
Dan J

Reputation: 25673

If you can't find a way to do this through Xcode you can always use the SVN command line from the Terminal to do it.

To see the diffs for revision 186 in Terminal run (press space to see the next page in the diffs, or q to quit):

svn diff -c 186 | more

To see the diffs made between revisions 179 and 186 run:

svn diff -r 179:186 | more

You can then copy a script like fmdiff and invoke FileMerge directly with the output of the diffs, e.g:

svn diff -c 186 --diff-cmd fmdiff

Upvotes: 1

Chris Trahey
Chris Trahey

Reputation: 18290

In the source-control split-view, there are revision selection controls at the very bottom. Both sides have this control available, so you can pick any arbitrary commits to diff:

change comparison revisions

Discolsure: I tested this with git and SVN, works great!

Upvotes: 1

Related Questions