Create & Applying patch from SVN

Create a patch for the change (e.g., r3199) by diffing its revision number against its predecessor:

>cd working/copy/of/branch
>svn diff -r 3198:3199 >r3199.diff

if you want to create patch as unified diff format, use this command

> svn diff –diff-cmd /usr/bin/diff -x “-ua ” -r3198:3199 > r3199.diff

Apply the patch to a working-copy of the trunk:

>cd working/copy/of/trunk/bro
>patch -p0 -b -B ./backup/ <r3199.diff

When something wrong happened, and you want to restore your working copy to original version (before applying the patch), you can invoke command:

> cd working/copy/of/trunk/bro
> patch -p0 -R < r3199.diff
Advertisement

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 )

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