Difference between revisions of "Creating and Applying Patches"

From Opentaps Wiki
Jump to navigationJump to search
m (Protected "Creating and Applying Patches": Sysop page [edit=sysop:move=sysop])
Line 1: Line 1:
 
= Creating Patches =
 
= Creating Patches =
  
== Specific Revision of Opentaps ===
+
== Patch of Changes that I Made ==
  
Suppose you wish to create a patch for a single revision of opentaps, such as the bugfix revision 9593.  You can use the <tt>svn diff</tt> command to do this. First, ensure you are in the root directory of opentaps,
+
To make a patch of the changes you made to opentaps, you can use the <tt>svn diff</tt> command from a terminal or command prompt.
 +
 
 +
First, ensure you are in the root directory of opentaps,
  
 
<pre>
 
<pre>
Line 9: Line 11:
 
</pre>
 
</pre>
  
To verify that you're in the right directory, ensure that it contains the build.xml and startofbiz.sh files.  Next, create the patch by executing the <tt>svn diff</tt> command and specify the revision with the <tt>-c</tt> argument,
+
To verify that you're in the right directory, ensure that it contains the build.xml and startofbiz.sh files.  Next, execute the <tt>svn diff</tt> command,
  
 
<pre>
 
<pre>
   prompt> svn diff -c 9593
+
   prompt> svn diff
 
</pre>
 
</pre>
  
The output will be printed on the screen. You can redirect it into a file as follows,
+
It will print the patch of all changes you made to the screen. To save the output to a file instead, use a redirect,
 +
 
 +
<pre>
 +
  prompt> svn diff > mychanges.patch
 +
</pre>
 +
 
 +
This command will create a <tt>mychanges.patch</tt> file that contains all changes you made to opentaps. 
 +
 
 +
If you wish to see changes of only one file or directory, you can specify the file or directory explicitly,
 +
 
 +
<pre>
 +
  prompt> svn diff applications/product
 +
</pre>
 +
 
 +
This command will make a patch of all your changes to the applications/product/ directory and its children.
 +
 
 +
== Patch of Specific Revision of Opentaps ==
 +
 
 +
Let's say you want to create a patch against a specific revision of opentaps, such as the bugfix revision 9593.  In order to do this, you will need either a complete checkout of opentaps that's fully up to date or internet access to the opentaps subversion repository.  Since it's simpler to use the online opentaps subversion repository, we will go over this technique here.
 +
 
 +
To make the patch, use the <tt>svn diff</tt> command and use the <tt>-c</tt> argument to specify the revision,
  
 
<pre>
 
<pre>
   prompt> svn diff -c 9593 > bugfix.patch
+
   prompt> svn diff -c 9593 svn://svn.opentaps.org/opentaps/versions/1.0/trunk > bugfix.patch
 
</pre>
 
</pre>
  
 
The file <tt>bugfix.patch</tt> is created and it contains a specific revision of the opentaps repository.
 
The file <tt>bugfix.patch</tt> is created and it contains a specific revision of the opentaps repository.

Revision as of 21:32, 2 October 2008

Creating Patches

Patch of Changes that I Made

To make a patch of the changes you made to opentaps, you can use the svn diff command from a terminal or command prompt.

First, ensure you are in the root directory of opentaps,

  prompt> cd opentaps

To verify that you're in the right directory, ensure that it contains the build.xml and startofbiz.sh files. Next, execute the svn diff command,

  prompt> svn diff

It will print the patch of all changes you made to the screen. To save the output to a file instead, use a redirect,

  prompt> svn diff > mychanges.patch

This command will create a mychanges.patch file that contains all changes you made to opentaps.

If you wish to see changes of only one file or directory, you can specify the file or directory explicitly,

  prompt> svn diff applications/product

This command will make a patch of all your changes to the applications/product/ directory and its children.

Patch of Specific Revision of Opentaps

Let's say you want to create a patch against a specific revision of opentaps, such as the bugfix revision 9593. In order to do this, you will need either a complete checkout of opentaps that's fully up to date or internet access to the opentaps subversion repository. Since it's simpler to use the online opentaps subversion repository, we will go over this technique here.

To make the patch, use the svn diff command and use the -c argument to specify the revision,

  prompt> svn diff -c 9593 svn://svn.opentaps.org/opentaps/versions/1.0/trunk > bugfix.patch

The file bugfix.patch is created and it contains a specific revision of the opentaps repository.