Creating and Applying patch

17 Sep

Steps to creating the patch:

First, check out the most recent version of the code from Subversion using the ‘checkout’ command.

Make ur changes

Then, in the root the project run the following command. It will store the patch file in your home directory.

svn diff > patch1.diff

Steps to Apply the patch:

$ patch -p0 < /path/to/patch1.diff
p0 option is to remove the ’0′ prefix path element.
p1 option is to remove the ’1′ prefix path element. i.e if your patch has paths
+++ a/b/c.orig
—a/b/c
…..

patch -p0 would apply on ‘a/b/c’ on your target.
patch -p1 would apply on ‘b/c’ on your target.
patch -p2 would apply on ‘c’ on your target.


Advertisements

One Response to “Creating and Applying patch”

  1. Kamesh Jayachandran 09/23/2010 at 7:11 pm #

    >(p0 option makes sure that all files can be found correctly)

    p0 option is to remove the ‘0’ prefix path element.
    p1 option is to remove the ‘1’ prefix path element. i.e if your patch has paths
    +++ a/b/c.orig
    —a/b/c
    …..

    patch -p0 would apply on ‘a/b/c’ on your target.
    patch -p1 would apply on ‘b/c’ on your target.
    patch -p2 would apply on ‘c’ on your target.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: