Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing 2 revisions with svn diff (v 1.3.2) and get the changed paths only?

Tags:

diff

svn

I want to compare 2 revisions using version 1.3.2 of svn and copy the changed files/folders to some place on the server. The copying is not the problem, what I have trouble with is getting only the changed paths. I am using this command:

svn diff -r 90:93 URL --username name --password password

This returns me a lot of information, how would I extract only the changed paths from that info? The --summarize is not available for version 1.3.2. What I want is something like:

/path/test.txt

Thanks! :)

like image 830
EOB Avatar asked Jan 09 '12 14:01

EOB


People also ask

How do you find the difference between two svn 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 changes 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.

Which command is used to show the difference between two revisions?

The diff command is used to compare different revisions of files. The default action is to compare your working files with the revisions they were based on, and report any differences that are found. If any file names are given, only those files are compared.

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.


1 Answers

Are you on Unix/Linux/Mac, or have Cygwin installed?

You could pipe the output through grep to find all the lines that begin with Index:. (If I remember Subversion 1.3's diff command output) That would give you just the names of the files that differ. It's what I use to do with CVS.

$ svn diff -r 90:93 --username name --password password URL | grep "^Index: "

If that works, and you want to remove Index, you can use sed:

$ svn diff -r 90:93 --username name --password password URL \
> | sed -n /^Index: /s/^Index: //p'
like image 192
David W. Avatar answered Oct 23 '22 08:10

David W.