Subversion
If you keep drupal or selected modules under version control with Subversion, you can create patches using the built in diff command.
Issueing the following command in the directory of the working copy, will create a patch with differences between the latest revision (HEAD) and the working copy.
svn diff > file.patchIf you work incrementally, often commiting changes to your local Subversion repository and you want to generate a patch with changes between the original module (initial import or revision 1) and the working copy issue the command:
svn diff -r1 > file.patchThe output of Subversions built-in diff command misses the function names that make patch evaluation easier. To remedy this, replace Subversions built-in diff with an external diff utility. UnxUtils contains a native Windows binary that is suited for this.
- Install UnxUtils in a suitable folder, this page assumes
c:\unxutils - Create a batchfile
diffup.batinc:\unxutilscontaining the commands
@echo off
c:\unxutils\user\local\wbin\diff.exe -u -F^function %* -
Open
%SystemDrive%\Documents and Settings\[Username]\Application Data\Subversion\config(usually on c:) -
Locate the section
[Helpers]and add the line
diff-cmd = c:\unxutils\diffup.bat
Subversion will now use the external diff program, generating patches that are easy to interpret.
Note: diff on Windows generates files containing CRLF line-endings. To enable the use of these patches on a UNIX system, convert to LF line-endings with a text editor or a dos2unix utility.
