Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn diff between previous and new working copy

Tags:

diff

svn

suppose that I have made some changes since last update (revert) to my a.b file. this a.b file is also changed in the repository. Now I want to compare the changes I made with the repos changes.

If I svn revert the file, I can see the changes between new and previous download (previous download doesn't have my changes). How can I see differences between the repository changes and mine?

thanks

like image 307
Computer_guy Avatar asked Feb 22 '12 16:02

Computer_guy


People also ask

How do you find the difference between two revisions in svn?

Pick the two revisions you want to compare then use Context Menu → Compare Revisions. If you want to compare the same item in two different trees, for example the trunk and a branch, you can use the repository browser to open up both trees, select the file in both places, then use Context Menu → Compare Revisions.

What is working copy in svn?

A Subversion working copy is your own private working area, which looks like any other ordinary directory on your system. It contains a COPY of those files which you will have been editing on the website. You can edit these files however you wish, in the usual way.

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 does svn diff work?

If the alternate syntax is used, the server compares URL1 and URL2 at revisions N and M , respectively. If either N or M is omitted, a value of HEAD is assumed. By default, svn diff ignores the ancestry of files and merely compares the contents of the two files being compared.


2 Answers

svn diff -r HEAD a.b

I think you have to specify the HEAD revision if something changes in the repository.

But now that I re-read your question, it looks like you:
made a change
committed the change
now want to view those changes

In that case, you can get your current revision number with

svn info a.b

subtract 1 from it, and use it in the svn diff.

for example, if your current revision is 100

svn diff -r 99:100

like image 129
FlipMcF Avatar answered Oct 12 '22 12:10

FlipMcF


If you are using Subclipse in Eclipse it will mark the file as conflict and when you double click on the conflicting file, it will show you on the one side your local file and on the right side the repositiry file.

The conflicts are marked red, and you can easily assume the changes or mark as merged.

For more information : http://subclipse.tigris.org/

like image 40
Johnny2012 Avatar answered Oct 12 '22 12:10

Johnny2012