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

'svn patch' deletes random lines with patch files missing trailing newline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • trunk
    • 1.7.x
    • libsvn_diff
    • None

    Description

      % ./new.sh >/dev/null
      % cd wc1/trunk/
      % echo foo > iota
      % $svn di -x-p >1
      % vim -c 'set bin noeol' -c wq ./1
      % $svn revert -q -R ./ 
      % patch -p0 < ./1
      patching file iota
      patch unexpectedly ends in middle of line
      patch: **** malformed patch at line 6:  
      
      zsh: exit 2     patch -p0 < ./1
      % $svn revert -q -R ./
      % $svn patch 1
      D         iota
      % $svn di
      Index: iota
      ===================================================================
      --- iota	(revision 1)
      +++ iota	(working copy)
      @@ -1 +0,0 @@
      -This is the file 'iota'.
      % 
      
      
      patch(1) complains, but 'svn patch' just deletes some line from the file.  In
      this contrived example it deleted the only line in the file and so deleted the
      file as well; in a real-life example (which I'll attach in a second), it deleted
      the last line of the last hunk from the patched file.
      

      Attachments

        1. 1_AneYmTma.txt
          4 kB
          Daniel Shahaf

        Activity

          People

            Unassigned Unassigned
            danielsh Daniel Shahaf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: