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

diff on a schedule-replace file shows wrong difference

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • all
    • unscheduled
    • libsvn_wc
    • None

    Description

      Run this recipe:
      
         #!/bin/sh
         
         URL=file:///`pwd`/repos
         rm -rf repos wc
         svnadmin create repos
         svn co -q ${URL}/ wc
         
         # Add a file.
         echo "This is the original file." > wc/file
         svn add -q wc/file
         svn ci -q -m "Commit original file." wc
         svn up -q wc
         
         # Replace the file.
         svn rm -q wc/file
         echo "New file, new contents." > wc/file
         svn add -q wc/file
         
         # Show the diff.
         cd wc
         svn diff
      
      You'll see a difference between the old and new files:
      
         Index: file
         ===================================================================
         --- file	(working copy)
         +++ file	(working copy)
         @@ -1 +1 @@
         -This is the original file.
         +New file, new contents.
      
      ... even though they are not related and should not be diffed against each
      other!  Probably a more correct behavior would be to show two separate file
      diffs, one containing all deletions, followed by another containing all additions.
      
      Note that diff_tests.py 4, diff_replace_a_file(), currently expects the above
      bogus behavior.
      
      This may be related to issue #1675, not really sure.
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kfogel Karl Fogel
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: