subversion-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Zhakov (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SVN-4464) diff repo to wc diff against a copy with --show-copies-as-adds is busted
Date Sat, 17 Oct 2015 13:30:05 GMT

    [ https://issues.apache.org/jira/browse/SVN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14932732#comment-14932732
] 

Ivan Zhakov edited comment on SVN-4464 at 10/17/15 1:29 PM:
------------------------------------------------------------

I wouldn't be surprised if all this is caused by driving the editor in an unsupported way.

The repos-wc diff reporter is not driven by the wc crawler for this specific scenario, while
the editor that receives the changes is just the standard editor.

All working copy editors assume that the changes they receive are against the BASE layer (=lowest
/ as checked out), while in this case the diff you want to show is probably against WORKING
(= the copied thing).

We abuse {{svn diff}} in far too many ways to really fix this without breaking any of the
existing dozen use cases.
{noformat}
svn diff ^/foo bar --show-copies-as-adds
{noformat}

would usually show what is in the repository at location BAR against what you  have in your
local working copy. But you have a copy in your local working copy.

So what do you want to see?

A delete of everything at ^/foo (as BASE doesn't exist) and everything you have local as addition
(the show copies-as adds)?

Or something magic with the copyfrom source of bar? Or a combination of both?

I think what you see is some form of the last... a delete of the repository side... and your
local copies as additions. If you wouldn't use {{--show-copies-as-adds}} you probably see
the same deletes, but the copies diffed against their pristine (=pre copy) version.



was (Author: rhuijben):
{noformat:nopanel=true}
I wouldn't be surprised if all this is caused by driving the editor in an 
unsupported way.

The repos-wc diff reporter is not driven by the wc crawler for this specific 
scenario, while the editor that receives the changes is just the standard 
editor.

All working copy editors assume that the changes they receive are against the 
BASE layer (=lowest / as checked out), while in this case the diff you want to 
show is probably against WORKING (= the copied thing).

We abuse 'svn diff' in far too many ways to really fix this without breaking 
any of the existing dozen use cases.

svn diff ^/foo bar --show-copies-as-adds

would usually show what is in the repository at location BAR against what you 
have in your local working copy. But you have a copy in your local working copy.

So what do you want to see?

A delete of everything at ^/foo (as BASE doesn't exist) and everything you have 
local as addition (the show copies-as adds)?

Or something magic with the copyfrom source of bar?
Or a combination of both?

I think what you see is some form of the last... a delete of the repository 
side... and your local copies as additions. If you wouldn't use --show-copies-
as-adds you probably see the same deletes, but the copies diffed against their 
pristine (=pre copy) version.

{noformat}


> diff repo to wc diff against a copy with --show-copies-as-adds is busted
> ------------------------------------------------------------------------
>
>                 Key: SVN-4464
>                 URL: https://issues.apache.org/jira/browse/SVN-4464
>             Project: Subversion
>          Issue Type: Bug
>          Components: libsvn_client
>    Affects Versions: 1.8.x
>            Reporter: Ben Reser
>            Assignee: Ben Reser
>             Fix For: ---
>
>
> This happens on 1.8.x and trunk (1.7 has other issues which is how I ended up finding
this)
> {noformat}
> svnadmin create repo
> svn co file://$PWD/repo wc
> cd wc
> echo foo > foo
> svn add foo
> svn ci -mm
> svn up
> svn cp foo bar
> svn diff ^/foo bar --show-copies-as-adds
> {noformat}
> Which produces:
> {noformat}
> Index: bar
> ===================================================================
> --- bar	(file:///Users/breser/double-diff/2/repo/foo)	(revision 1)
> +++ bar	(.../bar)	(working copy)
> @@ -1 +0,0 @@
> -foo
> Index: bar
> ===================================================================
> --- bar	(file:///Users/breser/double-diff/2/repo/foo)	(revision 0)
> +++ bar	(.../bar)	(working copy)
> @@ -0,0 +1 @@
> +foo
> {noformat}
> Yes really two diffs for the same file.  Same behavior happens with directories.
> {noformat}
> svn mkdir a
> echo b > a/b
> svn add a/b
> svn ci -mm
> svn up
> svn cp a aa
> svn diff ^/a aa --show-copies-as-adds
> {noformat}
> {noformat}
> Index: aa/b
> ===================================================================
> --- aa/b	(file:///Users/breser/double-diff/2/repo/a)	(revision 2)
> +++ aa/b	(.../aa)	(working copy)
> @@ -1 +0,0 @@
> -b
> Index: aa/b
> ===================================================================
> --- aa/b	(file:///Users/breser/double-diff/2/repo/a)	(revision 0)
> +++ aa/b	(.../aa)	(working copy)
> @@ -0,0 +1 @@
> +b
> {noformat}
> Finally for some more fun you can actually segfault the client like so:
> {noformat}
> svn rm bar
> svn ci -mm
> svn cp foo bar
> svn diff ^/foo bar
> {noformat}
> This might be related but I'm not sure yet.
> Doing the a wc to wc diff e.g. {{svn diff foo bar --show-copies-as-adds}} works as expected
in all the above cases so if someone has ran into this issue they can do that.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message