Table of Contents |
---|
Getting the source code
First of all, you need the Pig source code.
...
Please make sure that all the core unit tests succeed before constructing your patch.
Code Block |
---|
> cd trunk
> ant -Djavac.args="-Xlint -Xmaxwarns 1000" clean jar test-commit
|
...
After a while, if you see
Code Block |
---|
BUILD SUCCESSFUL
|
all is ok, but if you see
Code Block |
---|
BUILD FAILED
|
then please examine error messages in build/test and fix things before proceeding.
...
Please also check the javadoc.
Code Block |
---|
> ant docdocs > firefox build/docs/api/index.html |
Examine all public classes you've changed to see that documentation is complete and informative. Your patch must not generate any javadoc warnings.
...
Check to see what files you have modified with:
Code Block |
---|
svn stat
|
Add any new files with:
Code Block |
---|
svn add src/.../MyNewClass.java
|
In order to create a patch, just type:
Code Block |
---|
svn diff > myBeautifulPatch.patch
|
...
If working from a git repo, please be aware the the default diff format will not apply in SVN repos. Please generate patches with the --no-prefix
option so they apply cleanly.
Code Block |
---|
git diff --no-prefix
|
h3. Testing a patch (Ignore this section for now)
...
To use this target, you must run it from a clean workspace (ie svn stat
shows no modifications or additions). From your clean workspace, run:
Code Block |
---|
ant \
-Dpatch.file=/patch/to/my.patch \
-Dforrest.home=/path/to/forrest/ \
-Dfindbugs.home=/path/to/findbugs \
-Djava5.home=/patch/to/java5home \
-Dscratch.dir=/path/to/a/temp/dir \ (optional)
-Dsvn.cmd=/path/to/subversion/bin/svn \ (optional)
-Dgrep.cmd=/path/to/grep \ (optional)
-Dpatch.cmd=/path/to/patch \ (optional)
test-patch
|
...
To apply a patch either you generated or found from JIRA, from the trunk
directory you can issue
Code Block |
---|
patch -p0 <cool_patch.patch
|
if you just want to check whether the patch applies you can run patch with --dry-run option
Code Block |
---|
patch -p0 --dry-run <cool_patch.patch
|
...