32

I want see only the list of files that have been modified, added, etc., not the content (svn diff outputs that), only the list of files like svn status.

svn diff -r HEAD dumps me tons of information, which is hard to understand quickly.

svn status shows only the changes comparing the working copy with its local original version (not with the repository revision).

svn update does not support --dry-run

Briefly, I need something like svn status, but what compares the current working copy with the repository revision (I'm going to compare with a HEAD revision).

I looked through the SVN manual, but nothing helped to me, unfortunately :-/

Azat
  • 681
  • 1
  • 7
  • 13

6 Answers6

46

Try

svn status --show-updates

The -u (or --show-updates) option to svn status causes svn to contact the repository and show stuff that's changed in the repository - is that enough for you ? Depending on what you need, you might want the -q or --verbose flag too

nos
  • 223,662
  • 58
  • 417
  • 506
  • Can I compare, for example, two revisions? `svn status -r4:5` is not supported. – Azat Feb 07 '11 at 21:49
  • Or it is a question for another topic? – Azat Feb 07 '11 at 21:54
  • 1
    @Azat '*' means there's a newer revision in the repository then – nos Feb 07 '11 at 21:55
  • 2
    @Azat See http://stackoverflow.com/questions/167371/how-do-i-see-what-files-were-changed-between-2-revisions if you need to see which files are changed between arbitary revisions – nos Feb 07 '11 at 21:58
  • @nos: `svn log -v -rX:Y .` is great! Thank you! – Azat Feb 07 '11 at 22:05
  • Unfortunately, `svn status -u` does not compare against the HEAD revision, but only against whatever revision the working copy is currently at. Try it: `svn up -r12345; svn status -u` – Ed Avis Sep 25 '14 at 10:50
32
svn diff -r head

This will produce a diff listing for all files which differ between the working copy and the repository, giving a list of files and the actual changes. Which, as you say, can be hard to understand.

So try this:

svn diff -r head --diff-cmd meld

This dos the same thing, but displays the changes using meld (you can provide any other visual diff tool in your arsenal), which is a lot more manageable.

But seriously, get used to reading those diff outputs, as they form the basis for so many other things (for example, patches) and are pretty hard to avoid in the Linux world. To cut down on the output:

svn status -u 

will give you a list of modified files, then:

svn diff <file> -r head --diff-cmd <tool>

will give you a visual difference of just the particular file you are interested in.

kdopen
  • 8,032
  • 7
  • 44
  • 52
  • 1
    Sweet, thanks. This is exactly the answer I was looking for. Meld has nice ability to compare whole directories, do You know the way to send SVN working copies to this program in such way? So that we can preview the entire structure. – Line Sep 25 '14 at 11:17
  • @kdopen, apologies for the downvotes. Despite me being pissed off the deletion of one of my answers, did not downvote personally.:D I have a very inventive friend visiting who (knowing me being angry) used this situation and my unattended computer and account to make an elaborate prank on me and downvoted many answers. Childish I must say, but a truly smart prank which obviously served it's purpose of me embaracing myself on the StackOverflow community. :D At least I hope someone had a nice laugh on my account. :D – AlexRebula Aug 01 '17 at 03:37
  • Well, looks like the system corrected it. Try not to let the review system get to you. When you hit 500 reputation (about 3 upvotes from now), you'll find yourself starting to work the queues as well - then you realize you just have to focus on the rules, and not worry about how people will feel about your review. I get many comments each day from people who've had a negative review - and I've had my own stuff reviewed and deleted over time. This is what sets us apart from the mess of sites like Quora – kdopen Aug 01 '17 at 03:51
2

The way you worded the original question, the right answer is svn status -u as given already. Based on followup comments, you should also be aware of svn diff --summarize as this might be what you are looking for. This is what you would use to compare two repository revisions or two tags or something else in the repository. You cannot use this option to compare your working copy with the repository (status does that).

See: http://blogs.collab.net/subversion/2007/03/computing_the_d/

Mark Phippard
  • 10,329
  • 2
  • 32
  • 42
1

Here's what I did, and it solved my problem: I want to see what's different between my working copy and the repo's copy.

svn diff > ~/svndiff.txt

And then I pulled up the plaintext file in SublimeText 2 so I could read it easier. Guess this is pretty basic stuff, but thought I'd post it since it helped me with a similar issue.

cdmo
  • 1,239
  • 2
  • 14
  • 31
1

This may be what you are looking for:

svn diff -r HEAD --summarize

maxim1000
  • 6,297
  • 1
  • 23
  • 19
1

op:

I want see only the list of files that have been modified, added, etc., not the content (svn diff outputs that), only the list of files like svn status.

Like the OP, I want to see an "svn status" style report of the current working copy for project branches that are nested below a larger svn repository against their latest trunk and I want to use the same path and revision arguments that svn diff uses.

The following does that:

svn diff --old . --new ^/pathToProject/trunk --summarize

Of course, replace "pathToTrunk" to the actual path your repository uses.

Lonnie
  • 88
  • 1
  • 6