Reputation: 9621
I know that from a command prompt, I could do something like
svn diff -rXXX foo.bar
to compare my working copy of foo.bar
with the revision XXX
, even if this revision was on a merged branch.
How can I do the same with TortoiseSVN? It works like a charm with past revisions on the same branch as my WC but not on different ones...
EDIT:
Thanks to Rob's answer I'm now able to compare a file in my working copy to a past revision that's sitting on a merged branch. The last thing I would like to know is if it's possible to manually merge some of the diffs to my working copy:
Is there a work-around for that?
Upvotes: 23
Views: 11512
Reputation: 39404
Upvotes: 5
Reputation: 36698
@Rob's answer works, of course, but requires you to look up then type in a potentially long URL. You can accomplish the same task with just a couple mouse clicks and no typing at all:
TortoiseSVN >> Revision Graph
.compare revisions
.In the illustration, revision 22175 is my working copy on one branch. I chose node 18568 on a different branch to compare to--both nodes are marked with a purple square.
2013.02.14 Update: Compare working copy, not just working base!
Yannick, thanks for reminding me to distinguish between working copy and working base. My previous illustration was indeed comparing working base to any arbitrary node. The revised illustration shows how to comparing working copy to any arbitrary node. To do this, notice the two right-most buttons on the toolbar. The black-encircled WC button displays and highlights the working base, in this case 22175. The red-encircled WC button displays and highlights the working copy as a special red node labeled Modified
. Once you materialize that node, you now have a modified working copy that you can touch, grab, fold, spindle, or mutilate as you see fit! You can, for example, view your working copy modifications by selecting Modified first then select the working base (22175 in this case) and compare those revisions.
Final note: when selecting the Modified
node, order is important! Select Modified
first then control+select the node to compare. This gives you a compare revisions
choice on the context menu. If you do it the other way around, you get a unified diff
choice only.
Upvotes: 13
Reputation: 2777
One way that you can accomplish this is to hold the shift key down when you right click on the file in your working copy that you want to diff. Select TortoiseSVN->Diff with URL. This brings up a dialog that allows you to put in the full server path name to file on the branch you want to diff against. It also allow you to specify the Revision as well. This brings up the TortoiseSVN diff with the 2 files and the differences.
For more information on this you can read this link: Viewing Differences . This is specifically talked about in the "Differences to another branch/tag" section
Upvotes: 25