Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a SVN diff from the point a branch was started to HEAD?

Tags:

svn

I'd like to see what changes have occurred on a branch, but I'm not sure how. I'd imagine I'd need to find the first revision of the branch and use that?

Googling has not helped me.

like image 459
alex.collins Avatar asked Jan 08 '13 14:01

alex.collins


People also ask

How do I find the difference between two branches in svn?

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 compare codes in svn?

Just hold down the Shift key while you right click on the file. Then select TortoiseSVN → Diff with URL. In the following dialog, specify the URL in the repository with which you want to compare your local file to.

How do you find changed files in svn?

svn log then defaults to fetching the history of the directory at its current revision, and thus you don't see the newly committed changes. The solution here is to either update your working copy or explicitly provide a revision number to svn log by using the --revision ( -r ) option.

What is the use of svn diff command?

The svn diff command reveals the differences between your working copy and the copy in the master SVN repository.


2 Answers

Roughly

svn log --diff --stop-on-copy https://subversion/.../branches/BR-2-7-3
like image 163
alex.collins Avatar answered Oct 14 '22 14:10

alex.collins


You are correct, it is a matter of doing a diff between the revision number of when the branch was created and the revision number of the version you wish to compare it to (in this case it is probably the latest commit on the branch)

You will need to perform this in two steps:

1) Find the revision number of when the branch was created and the revision number of the latest commit

svn log --stop-on-copy <branch location eg. "https://subversion/.../branches/BR-2-7-3">

This will show you a log of all the commits on the branch with the latest one at the top (in the form rYYYY) and the start of the branch at the bottom (in the form rXXXX). Remember the revision number of both of those commits (XXXX and YYYY)

2) Do a diff between those two revisions

svn diff -rXXXX:YYYY <branch location eg. "https://subversion/.../branches/BR-2-7-3">
like image 31
Piyush Avatar answered Oct 14 '22 13:10

Piyush