Just a tip for not forget how to merge between branches properly. Merge from stable to default, in this example we are on stable:

(All changes has to be be committed)
hg commit -m "My new features"
hg pull --rebase
hg push
hg update default //change to default branch
hg merge stable // merge the stable changes
hg commit -m "Merge from stable to default"
hg push
(Remind go again to the proper branch, if needed)
hg update stable //change to stable branch

Advertisements

It’s usual deal with some branches if your project is big, and sometimes could be pretty dangerous changing, commiting and merging between branches, in our actual project we have three: default, stable and experimental. Last week I was commiting to default and I had to resolve a bug on stable, merge it on default, hours after merge the default changes to stable, in order to make a new production release, and merge also with experimental with their changes… so I had to be very careful… I though it were so cool have the branch in the shell prompt, and seems more people thinks like me, I discovered http://sjl.bitbucket.org/hg-prompt/ it doesn’t only show the branch, also the status, bookmarks and more… really useful.

There are also for Git and SVN:

http://hocuspokus.net/2009/07/add-git-and-svn-branch-to-bash-prompt/

Today I was improving some code switching (inmutable) lists to tuples, after the change I run the tests, one fails and triying to find the error I discover that the tuples are not really the same than an inmutable list, at least if they have one element. The example:


>>> t = ('ES')
>>> for i in t:
... print i
...
E (this is one element)
S (this is another element but I were expected both together, 'ES')

And:

>>> t = ('ES',) (Notice the comma)
>>> for i in t:
... print i
...
ES (one element, what I expected)

I don’t know if it’s a bug…, in lists is the same if you write or not the comma if only has one element.

Probably I had not discovered it until my app breaks, so remember, on tuples and lists with one element EVER use the comma too, and of course, TDD.

Hello world!

March 31, 2009

Yes, Hello world! not “Hola Mundo”, I have been thinking on write some technical post in English, it will be a good idea to practice my (bad) English.

I will have a lot of grammar and semantic mistakes but I have a good “code debugger”, Carlos Ble 😉