Contributing PatchesWell-described, easy-to-apply patches are a pleasure for a developer to receive and go a long way towards making the IDE more stable and powerful, so thank you in advance for contributing them! Here's how to do it. These instructions assume you are working on recent versions of NetBeans
source code, starting with 6.1, which are kept in a Mercurial repository. If for
some reason you need to submit a patch made against 6.0 sources or older (which
is discouraged), the ideas are similar, but you will need to use CVS
commands (generally Making and applying a patchFirst, make sure you are making changes in the most recent version of the
sources - for this, it is best to use Mercurial to obtain out the source
(usually from the $ cd /sources/netbeans/main make your edits to fix bug #123456... $ hg diff -g > /tmp/123456.diff sanity-check the patch $ hg up -C revert local modifications to get clean sources again Common patch mistakes include:
You might prefer to commit your change locally ( If you plan to submit various patches and keep some of them active in your
local copy of NetBeans sources unless and until they are accepted, a better
approach is to use Mercurial Queues. First some setup in your
[extensions]
mq =
[hooks]
# For safety; would be different on non-Cygwin Windows:
prechangegroup.mq-no-pull = ! hg qtop >/dev/null 2>&1
Now to work: $ cd /sources/netbeans/main $ hg qinit $ hg qnew 123456.diff make your edits to fix bug #123456... $ hg qrefresh -g $ hg export -g qtip > /tmp/123456.diff sanity-check the patch Later you can run
$ cd /sources/netbeans/main
$ hg qpop -a
$ hg pull -u
use hg qdel to remove any patches which have been accepted
and see if you can apply your patches again. The Mercurial electronic book also describes how to use merging facilities to make it easier to apply patches which conflict with other changes, as well as many more details on using MQ. A properly made patch is easy to apply by someone with repository push access who has reviewed it: save patch to disk, say /tmp/123456.diff $ cd /sources/netbeans/nb_all $ hg import /tmp/123456.diff test, do a build, use hg rollback if patch is bad Note: Mercurial 0.9.5 will record the commit as having been made by you, in
case the patch itself contains no authorship information. ( Making a patch available and accepting itThe best way to submit a patch is through Issuezilla. First, if an issue describing the problem (or feature) you are trying to solve already exists, use it. If it does not, create an issue now. The issue should include at least the following:
The developer responsible for the section of code affected should either
apply the patch and mark the issue Notifications of any changes to Issuezilla, as well as pushed Mercurial changesets, are automatically sent to the appropriate bug and source control mailing lists, so you can monitor if the patch has really been applied. Make sure you subscribe to the appropriate mailing lists for the module(s) you are working on - see the mailing lists page for details. Of course, if you do not know exactly how to fix a problem, but have an idea that it is being caused by a certain section of code somehow, you can just mention what you know on the developer list and maybe someone else will know how to fix it. And please report a bug about it so it does not get lost. |
Releases & PlanningHow Do IFile BugsContribute Code
Develop RCP Apps on the NetBeans Platform NetBeans Platform APIs Guidelines Get ConnectedMailing ListsNetBeans Wiki Blogs News Events Teach with NetBeans IDE Translate NetBeans IDE |