Difference between revisions of "Contribution"

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search
m (change repo case)
 
(4 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
If you prefer video tutorials, you can [http://www.youtube.com/watch?v=ZjFOvLGnAiU watch this tutorial].
 
If you prefer video tutorials, you can [http://www.youtube.com/watch?v=ZjFOvLGnAiU watch this tutorial].
 +
 +
While this is a practical guide, you should also read [http://www.cegui.org.uk/docs/current/devel.html the general guidelines] and the [http://www.cegui.org.uk/docs/current/code_standards.html Coding Standards] from the CEGUI Developer Documentation.
  
 
'''Note''': This tutorial describes contribution to [[CEED]] (CEGUI Editor) as a user '''kornerr''' as an example.
 
'''Note''': This tutorial describes contribution to [[CEED]] (CEGUI Editor) as a user '''kornerr''' as an example.
  
== 1. Import CEED repository to BitBucket ==
+
== Import CEED repository to BitBucket ==
  
 
Go to [https://bitbucket.org/repo/import Repositories -> import repository].
 
Go to [https://bitbucket.org/repo/import Repositories -> import repository].
Line 17: Line 19:
 
|-
 
|-
 
| URL
 
| URL
| http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/CEED
+
| https://bitbucket.org/cegui/ceed
 
|-
 
|-
 
| Requires authorization
 
| Requires authorization
Line 54: Line 56:
 
[[Image:Ceed contrib import repo done.png]]
 
[[Image:Ceed contrib import repo done.png]]
  
== 2. Clone from BitBucket to your machine ==
+
== Clone from BitBucket to your machine ==
 
  cd ~
 
  cd ~
 
  hg clone https://bitbucket.org/kornerr/ceed
 
  hg clone https://bitbucket.org/kornerr/ceed
Line 60: Line 62:
 
This will clone CEED repository from BitBucket to your home directory.
 
This will clone CEED repository from BitBucket to your home directory.
  
== 3. Make changes, commit, and push ==
+
== Make changes, commit, and push ==
  
 
Make changes. Mine were:
 
Make changes. Mine were:
Line 97: Line 99:
  
 
[[Image:Ceed_contrib_push.png]]
 
[[Image: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 https://bitbucket.org/cegui/ceed
 +
 +
Then simply push the changes back to your BitBucket repository:
 +
hg push

Latest revision as of 15:06, 11 January 2013

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 https://bitbucket.org/cegui/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 https://bitbucket.org/cegui/ceed

Then simply push the changes back to your BitBucket repository:

hg push