Menu

Hacking

AndreLDM

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 repository(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.

Make sure the local repo is synchronized and clean:

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

Create a new patch(do not use spaces nor uppercase in patch name):

hg qnew patch-name

A text editor will pop up, just let it blank and dismiss.
As you edit the source, run hg qrefresh to update the patch. You can check the status with "hg st --rev qparent" or diff with "hg qdiff".

When you finish your work, create the patch:

hg qrefresh -m "A brief summary of the changes you have made."
hg export qtip >~/patch-name.patch

To remove the patches(and its changes):

hg qpop

If you really want to remove it from the series:

hg qdelete patch-name

Not working with MQ? Here are a few hints:

To revert all non committed changes:

hg revert -C -a

To create a quick patch:

hg diff -g > ~/patch.diff

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.

Related

Wiki: Home