What svn command would list all the files modified on a branch?

Svn

Svn Problem Overview


In svn, I have a branch which was created, say at revision 22334. Commits were then made on the branch.

How do I get a list of all files that were changed on the branch compared to what's on the trunk? I do not want to see files that were changed on the trunk between when the branch was created and "now".

Svn Solutions


Solution 1 - Svn

This will do it I think:

svn diff -r 22334:HEAD --summarize <url of the branch>

Solution 2 - Svn

You can also get a quick list of changed files if thats all you're looking for using the status command with the -u option

svn status -u

This will show you what revision the file is in the current code base versus the latest revision in the repository. I only use diff when I actually want to see differences in the files themselves.

There is a good tutorial on svn command here that explains a lot of these common scenarios: SVN Command Reference

Solution 3 - Svn

You can use the following command:

svn status -q

According to svnbook:

With --quiet (-q), it prints only summary information about locally modified items.

WARNING: The output of this command only shows your modification. So I suggest to do a svn up to get latest version of the file and then use svn status -q to get the files you have modified.

Solution 4 - Svn

This will list only modified files:

svn status -u | grep M

Solution 5 - Svn

echo You must invoke st from within branch directory
SvnUrl=`svn info | grep URL | sed 's/URL: //'`
SvnVer=`svn info | grep Revision | sed 's/Revision: //'`
svn diff -r $SvnVer --summarize $SvnUrl

Solution 6 - Svn

-u option will display including object files if they are added during compilation.

So, to overcome that additionally you may use like this.

svn status -u | grep -v '\?' 

Solution 7 - Svn

svn log -q -v shows paths and hides comments. All the paths are indented so you can search for lines starting with whitespace. Then pipe to cut and sort to tidy up:

svn log --stop-on-copy -q -v | grep '^[[:space:]]'| cut -c6- | sort -u

This gets all the paths mentioned on the branch since its branch point. Note it will list deleted and added, as well as modified files. I just used this to get the stuff I should worry about reviewing on a slightly messy branch from a new dev.

Solution 8 - Svn

I do this as a two-step process. First, I find the version that was the origin of the branch. From within the checkout of the branch:

svn log --stop-on-copy |tail -4

--stop-on-copy tells SVN to only operate on entries after the branch. tail gets you the last log entry, which is the one that contains the branch information. The number that begins with an 'r' is the revision at which you branched. Then, use svn diff to find changes since that version:

svn diff -r <revision at which you branched>:head --summarize

the --summarize option shows a file list only, without the actual diff contents, similar to the 'svn status' output. If you want to see the actual diff, just remove the --summarize option.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTrentonView Question on Stackoverflow
Solution 1 - SvnandyView Answer on Stackoverflow
Solution 2 - SvnRobert DuchnikView Answer on Stackoverflow
Solution 3 - SvnmaskarihView Answer on Stackoverflow
Solution 4 - SvnhunterView Answer on Stackoverflow
Solution 5 - SvnHasskiView Answer on Stackoverflow
Solution 6 - SvnBinny JeshanView Answer on Stackoverflow
Solution 7 - SvnSweavoView Answer on Stackoverflow
Solution 8 - SvnKawaiiGuyNHView Answer on Stackoverflow