Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-4464

diff repo to wc diff against a copy with --show-copies-as-adds is busted

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.x
    • Fix Version/s: ---
    • Component/s: libsvn_client
    • Labels:
      None

      Description

      This happens on 1.8.x and trunk (1.7 has other issues which is how I ended up finding this)

      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
      

      Which produces:

      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
      

      Yes really two diffs for the same file. Same behavior happens with directories.

      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
      
      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
      

      Finally for some more fun you can actually segfault the client like so:

      svn rm bar
      svn ci -mm
      svn cp foo bar
      svn diff ^/foo bar
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              breser Ben Reser
              Reporter:
              breser Ben Reser
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: