Contribution

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Revision as of 01:26, 18 December 2011 by Pav (Talk | contribs) (Add links to general guidelines and coding standards)

Jump to: navigation, search

The article describes how you can contribute to a CEGUI project with the help of BitBucket.

We prefer your contribution through BitBucket, because it simplifies the development process for both you and us. If your contribution needs a bit more tuning, we just say so and you make another commit to your BitBucket repository. After we are satisfied with the quality of the fixes, we simply pull them from you repository. And since your repository is located under your nickname, we will know you can be trusted. So it's a win-win for everybody.

If you prefer video tutorials, you can watch this tutorial.

While this is a practical guide, you should also read the general guidelines and the Coding Standards from the CEGUI Developer Documentation.

Note: This tutorial describes contribution to CEED (CEGUI Editor) as a user kornerr as an example.

Import CEED repository to BitBucket

Go to Repositories -> import repository.

Input the following:

Source Mercurial repository
URL http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/CEED
Requires authorization No
Name CEED
Private No
Language Python (CEGUI itself is C++)
Description CEED contribution
Website Leave blank
Wiki Leave blank
Issue tracking Leave blank

Press Import.

BitBucket will import the repository:

Ceed contrib import repo.png

Wait a bit, and you're done:

Ceed contrib import repo done.png

Clone from BitBucket to your machine

cd ~
hg clone https://bitbucket.org/kornerr/ceed

This will clone CEED repository from BitBucket to your home directory.

Make changes, commit, and push

Make changes. Mine were:

diff --git a/compatibility/looknfeel/cegui.py b/compatibility/looknfeel/cegui.py
--- a/compatibility/looknfeel/cegui.py
+++ b/compatibility/looknfeel/cegui.py
@@ -95,6 +95,9 @@
         log = ""
         
         root = ElementTree.fromstring(data)
+        # Fix for Python < 2.7.
+        if not hasattr(root, "iter"):
+            root.iter = root.getiterator
         
         # version 7 has a version attribute
         root.set("version", "7")

Commit with a meaningful message, e.g., in my case it was:

hg commit -m "XML iterator fix for Python < 2.7. tested on Python 2.6"

And push it back to BitBucket:

kornerr@koren:~/ceed$ hg push
pushing to https://bitbucket.org/kornerr/ceed
searching for changes
http authorization equired
realm: Bitbucket.org HTTP
user: kornerr
password: 
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: bb/acl: kornerr is allowed. accepted payload.

You can see your changes at BitBucket now:

Ceed contrib push.png

Note: Please, don't try to merge many fixes into single commit. Place each fix into its own commit. It will be easier for us to understand your fixes and accept it faster.

Contact CEGUI developer(s)

Use IRC, mail, or mantis. Tell the URL of your repository and list the changesets you want into upstream.

Further contributions

If you will contribute again later, you need to first update your BitBucket repository to upstream version, and only then make changes. Please, do it, otherwise your fixes may be rejected simply because we can't spend hours in figuring out how to apply your old changes to the latest version.

To update your BitBucket repository to upstream version, go to your clone of BitBucket repository on your machine and do:

hg pull -u http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/CEED

Then simply push the changes back to your BitBucket repository:

hg push