Get the appropriate patch after removing svn and svn rename

  • I deleted some text files using svn remove. But it svn diffshows how to delete all the contents in a file. Applying the patch of this diff only modifies the contents, does not delete the file.

  • I renamed the directory containing the binaries using svn rename. A patch file svn diffdoes nothing out of the ordinary .

How to make svn diff create a file in which the patch will be applied when svn cp or svn mv were used?

subversion diff including new files

Both methods in the links above only make changes to the files. They are not deleted / renamed after applying the patch. Is it possible to get a working patch for the above changes?

+5
source share
3 answers

On the patchman page :

-E or --remove-empty-files Delete output files that are empty after the fixes have been applied. Usually this parameter is not needed, because patch can check the timestamps on the header so that my file should exist after correction. However, if the input is not a contextual difference, or if the patch matches on POSIX, the patch does not delete empty patched files if this option is not specified. When a patch deletes a file, it also tries to delete any empty directories of the ancestors.

+5
source

Try the following:

patch -p0 -E < 1.patch && svn rm `svn st -q | grep ^! | cut -c 9-`
+1
source

, OP SVN, SVN 1.7. (, , ) , svn diff , , .

, , , " ". svn 1.7 , svn 1.7 - diff (patches).

svn diff // diff !

: http://svn.haxx.se/dev/archive-2004-03/0333.shtml. SVN DEV , , - , 1.0.1 . , , , , 1.6 diff. 1.7.

, svn < 1.7 , svn delete 'd, , - diff. , , , , , , -E. , .

svn 1.7, diff, , , (), patch/quilt . , - .

Gotchas: Upgrading to 1.7 will make your working copies useless. Before upgrading, make sure you make your changes. Then you need to check everything again. Edit: The SVN 1.7 client can restore your working directories, but if you do not need to check it again. Just keep in mind that you will not lose your job.

+1
source

All Articles