Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By sp_key on
Hi all,
I need to apply a patch on a module but I don't know how.
The documentation I found on Drupal is mainly not on Windows. The video I watched here http://drupal.org/patch/apply is on MAC.
I am not particularly happy installing apps like tortoise as I'm not a developer. I just want to apply a simple patch.
Any ideas please?
Comments
It's amazing, but AFAIK (and
It's amazing, but AFAIK (and yes, I searched, often!) there is not a simple stand-alone patch apply tool for Windows. Many people will recommend you to install a linux command line environment like Cygwin, but that's not what you're looking for I think. If you're looking for some kind of a graphical user interface, I recommend either Tortoise SVN (ok, it's a developer tool with lots of functions that you won't need, but it's not as scary as it seems) or Aptana (an IDE which probably looks more familiar than Tortoise, but is larger and bulkier than Tortoise).
Yeah, that's the way it works
I guess this is where we put a gibe at Windows that they obviously don't want to make patching too easy.
On a more serious note: a lot of those types of tools on Windows include everything except the kitchen sink. Whereas the smaller, targeted tools were created by people trying to scratch their own itch, who were mostly working on Anything But Windows.
_
There's 2 child pages below the main patch/apply page that have less bulky patching tools for windows-- i use the gnuwin32 patch utility all time, works fine.
Yes, I'm afraid that we have
Yes, I'm afraid that we have to conclude that patching on windows is either bulky or techy.
_
techy?
Yes, believe it or not, to
Yes, believe it or not, to people who are only used to GUI's, every command line feels techy - not matter how simple the command is.
_
lol, true that-- sometimes i forget. In this particular case though, the wincvs gui makes my brain bleed and the command line is actually the simpler option. ;-)
In my case the techy bit is
In my case the techy bit is not the command.
I'm just not sure how to use this tool (gnuwin32) but I'll give it a second try.
btw, is it possible to move the patch and the "to-be-patched" files on a linux box, patch them there and move them back to my Windows machine?
_
Yep-- you can do it that way as well. But seriously, patching on windows really isn't that bad:
patch < name-of-file-to-patch.patch
.If you get errors, make sure the line endings of your site and the patch match-- on windows they need to be carriage return and line feed. I use notepad++ which makes checking them and converting them very simple (from the format menu).
EDIT:
Also good to know that
patch --help
will print out the help text for the app.UAC, Patch & Manifest
On Vista & Windows 7, you'll get prompted to grant patch the right to elevation (because of its name). Unfortunately, patch seems to lose its commandline arguments the moment you approve elevation via the UAC dialog.
Either rename the binary to apply_diff.exe or write a manifest file that specifies the requestedExecutionLevel as "asInvoker" (see Microsoft Technet).
Here's a sample manifest from the unxutils tracker. Simply drop it as patch.exe.manifest in the same directory as the patch binary.
WorldFallz thanks for
WorldFallz thanks for instruction. For me - the techy thing is when problem appears. In my case:
- both multi-file patch
- and for not existing files also (? creating new ones?) u can see here the patch: http://drupal.org/node/156783#comment-3623848
Also - the problem with Patch is... how to install it? just put the only one file - patch.exe in the root, where u've got .patch file and patched files? I did all your steps and after hitting command get new cmd blank window named with path .../patch.exe. After hitting patch --help the command line is refreshing...
You see, it's not that easy...:(
help... please
Mat
Patching on Windows
patch < context-2742913-11.patch
This worked for me using Aptana.
Thanks
The easiest way
The easiest way to apply a patch is using TortoiseSVN
1. Install TortoiseSVN
2. Copy patch file to root of drupal project directory ( for ex c:\wamp\www\btrain\ )
3. Right click on patch file > SVN Apply Patch
4. Chose project folder ( for ex c:\wamp\www\btrain\ )
5. TortoiseMerge appears : Right click on any file on 'File patches' window and select ' Patch All '
Patching on Windows
patch < context-2742913-11.patch
This worked for me using Aptana