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

patch application of `svn diff` output can ruin wc

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • all
    • 0.14.0
    • src
    • None
    • other

    Description

      repro recipe:
      
      $ rm iota
      $ svn revert
      $ svn revert iota
      
      iota is not restored.  Also note that this can lead to the following.  (which
      happened to me last night, but I caught it).
      
      $ edit iota
      $ svn up
      C ./iota
      $ svn diff > patchfile
      $ rm iota    # not needed but can slip in due to habit.
      $ svn revert iota # doesn't do anything
      $ patch -p0 < patchfile
      patching file ./.svn/text-base/iota # patch finds only one file, so it patches
      that.
      
      Thus your text-base becomes your working version.
      
      While svn revert should restore missing files, perhaps files in text-base should
      also have '.orig' or something appended to prevent accidental patching if the 
      file is missing.
      
      egrep also notes on IRC that this would make `find . -name "*.[ch]"' easier for 
      things like generating TAGS files.
      

      Original issue reported by kevin

      Attachments

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: