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

diff against a file between repo and wc with properties fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.x
    • 1.7.16
    • libsvn_client
    • None

    Description

      Running a diff against a file target with one repository path and one wc path
      fails if the file has a svn:mime-type property set and will produce spurious
      differences if any other properties (or --force is set to bypass the binary type
      check).
      
      This is really two separate issues, but I'll handle them as one for the purposes
      of this.  Both issues were created by the fixes introduced in 1.7.14 for issues
      #4153 and #4421.  Specifically the diff_repos_wc_file_target() function.
      
      1) The code is using the hash containing the properties as though the values are
      char pointers when they are actually pointers to a svn_string_t (C string vs
      counted length string).  This causes the property to be passed into the diff
      code with a garabage mimetype which makes the code believe the file is binary. 
      This particular issue also slipped into the
      diff_repos_repos_added_or_deleted_file() function as well.
      
      2) The calls to the file_changed callback are providing the wrong data for the
      propchanges argument.  This should be the difference between the source and
      targets files properties.  But instead it constructs the array as the entire
      state of the target properties.  Which causes the underlying code to act as
      though there is a difference, but then it ends up printing an empty difference.
      
      A reproduction recipe for this is:
      [[[
      Given the repository svn://scm.gforge.inria.fr/svn/mpfr/misc/vl-tests:
      
      $ svn co $repo
      A    vl-tests2/mpfrtests.data
      A    vl-tests2/mpfrtests.sh
      A    vl-tests2/release-3.1.2-p4
      A    vl-tests2/release-3.1.0-p8
      A    vl-tests2/vfy-data
      A    vl-tests2/ReadMe
      Checked out revision 8727.
      $ cd vl-tests
      $ svn diff -r 8276 ReadMe
      Index: ReadMe
      ===================================================================
      Cannot display: file marked as a binary type.
      svn: E000022: Valid UTF-8 data
      (hex: 73 76 6e 3a 6d 69 6d 65 2d 74 79 70 65 20 3d 20 28 48 67)
      followed by invalid UTF-8 sequence
      (hex: fb 20 0a 7f)
      $ svn diff -r 8726 ReadMe --force
      Index: ReadMe
      ===================================================================
      --- ReadMe	(revision 8726)
      +++ ReadMe	(working copy)
      
      Property changes on: ReadMe
      ___________________________________________________________________
      ]]]
      

      Attachments

        Activity

          People

            breser Ben Reser
            breser Ben Reser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: