Menu

Hacking

AndreLDM
There is a newer version of this page. You can find it here.

Hacking

Mercurial

First install mercurial in your system if you haven't done so.
You can get it from here or from your distro package manager.
Then do the minimal configuration, as explained here.

To clone the repository(anonymously):

hg clone http://hg.code.sf.net/p/kissplayer/code kissplayer-code

To clone the reposutory(with R/W access):

hg clone ssh://[username]@hg.code.sf.net/p/kissplayer/code kissplayer-code

Then you can start playing with the code. Once you finish working on a bug or a new feature, you should generate a patch for submission.
I strongly recommend using Queues, checkout this nice article by Mozilla.
But if you want something fast and simple, try the following:

Make sure the local repo is synchronized and clean:

hg in
hg pull (If there are commits pending)
hg st (Check the repository state)

Now create the patch(do not commit):

hg diff -g > ~/patch.diff

To revert all uncommited changes(with no backups):

hg revert -C -a

To apply a patch:

hg patch --no-commit ~/patch.diff

If you want to learn more about Mercurial, this tutorial by Joel Spolsky is a must.

Notes

  • Do not fix more than one issue in the same commit (except, of course, if one code change fixes all of them).
  • Do not do cosmetic changes to unrelated code in the same commit as some feature/bugfix.

Some Mantra(from Python)

  • Beautiful is better than ugly.
  • Explicit is better than implicit.
  • Simple is better than complex.
  • Complex is better than complicated.
  • Now is better than never.
  • Although never is often better than right now.
  • If the implementation is hard to explain, it's a bad idea.
  • If the implementation is easy to explain, it may be a good idea.