0

So I have two branches, b1 and b2. I have a working copy of b1 checked out at a certain revision, r1000, and I've merged in some changes from r1001 of b2.

I've manually edited a file foo, in my working copy, such that it's now identical to the r1000 revision of b1. However, when I do an svn diff, the output is a diff against the b2, r1001 revision, not the (empty) diff against b1, r1000 that I would expect.

Is there a generic way to get svn diff to say "this is what's going to change in the repository if you check this in", or do I have to specify branches and revision numbers on the command line to get what I want?

Ken White
  • 123,280
  • 14
  • 225
  • 444
David Moles
  • 48,006
  • 27
  • 136
  • 235
  • How is this different from what you asked at the end of [this question](http://stackoverflow.com/q/14698292/62576) that makes this not a duplicate? (Also, please avoid all of the "let's call it"wording; we can usually follow along without them. Thanks.) – Ken White Feb 05 '13 at 01:13
  • I asked this question first, didn't get any answers, and thought maybe I should ask a different question (which appears to have worked, at least partially). Would happily have deleted this one if that was an option. – David Moles Feb 05 '13 at 17:19
  • I flagged this one for the moderators to review (with a link to the other one) and asked if there was some way to merge the two. :-) – Ken White Feb 05 '13 at 17:42

1 Answers1

0

svn help diff, read this!

When you use svn diff <FILENAME> for modified file in Working Copy, it diffs (without additional options) against "pristine copy" of file, in your case it must be b1/foo@1000, not b2@1001 (BTW - when you merge, you merge branches, not single revision: from svn help merge, 1-st form "The optional '@REV' specifies both the peg revision of the URL and the latest revision that will be considered for merging")

If you want and have clearly identify diff sources, you must to write it in command and use 3-rd form of diff

diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]

where one of URL is file in WC, another URL - URL of file in repo (with PEG-revision, if needed)

this is what's going to change in the repository if you check this in

"...if you commit" we say in SVN-world, and this is diff against BASE-revision always, svn diff FILE (this diff contain both - merge- and manual - changes, if they exist /and such mix is bad practice and anti-pattern/)

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110