[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: diff with previous rev. in current branch

From: Ben Fritz <fritzophrenic_at_gmail.com>
Date: Mon, 9 Mar 2015 09:59:53 -0500

On Mon, Mar 9, 2015 at 4:27 AM, Jan Šilar <jansilar_at_jansilar.cz> wrote:
>
> I'm talking about this situation:
>
> r1
> / \
> r2 |
> | r3
> r4 |
>
> This is history of one file in two branches. If I do "Diff with
> previous version" in r4 then it is compared to r3 which is in another
> branch.

Are you saying you *want* to compare r4 to r3, or that SVN *is*
comparing these revisions? SVN should certainly not be comparing these
two revisions with a "diff with previous revision" command.

> These revisions vary with changes introduced in r4, r2 and r3. This
> is'n usually what I'm interested in. I just need to compare r4 and r3.
>

In SVN branches are just different directory copies. So when you do a
"diff with previous revision" you are comparing the file *in a given
directory* with the previous version that contained a change to that
same file in the same directory. There are very few (if any) commands in
SVN that are aware of a branch concept; SVN has no way of knowing if
your file in r3 is another "branch" of the same file, or if it is just a
copy that was placed somewhere else to establish a brand-new file with
its own history.

What you *can* do is a "diff with URL" which you can access by holding
the shift key before you right-click on the file. You can also select
two revisions from the revision graph in arbitrary branches, and diff
those.

r3 is only the "previous revision" by happenstance in your scenario;
most people understand "previous revision" to mean a predecessor, not to
mean it happened to be committed first on some other branch.

> BTW I used git instead of svn for last years so may be me conception
> of how branches in svn work is wrong.
>

If you want to compare r3 to r4, then neither git nor SVN acts this way.
In fact in Git you have no way of knowing whether r3 or r4 actually came
first, because everyone has their own repository, so they could have
pulled in r3's branch at a completely different time than you did.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3104070

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2015-03-09 16:00:25 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.