[pypy-dev] Mercurial workflow

Adrien Di Mascio adimasci at gmail.com
Tue Dec 14 18:42:04 CET 2010


Hi Jacob,

On Tue, Dec 14, 2010 at 6:04 PM, Jacob Hallén <jacob at openend.se> wrote:
> now that the switch to Mercurial has happened, people are discovering that
> their Subversion workflow habits don't quite work. This is because Mercurial
> has a distributed philosophy, inlike svn which has the concept of the holy
> central server where all operations take place.

It might be relevant for you to consider the mq extension :

- http://mercurial.selenic.com/wiki/MqExtension
- http://mercurial.selenic.com/wiki/MqTutorial
- http://mercurial.selenic.com/wiki/MqExtension

I find it very convenient on a daily-basis usage. When you want to
implement or fix something, you just create a new patch :

$ hg qnew my_new_idea

You then start to modify code and update your patch whenever you feel
the current version of your code is better than the previous one :

$ hq qrefresh

Then, when you're happy with it, all tests pass, etc., unapply your
patch, pull the new changesets from the "central" repository, and then
reapply your patch :

$ hg qpop                           # pop your patch
$ hg pull central_repo_url     # pull new changesets
$ hg up
$ hg qpush                         # reapply your patch
$ <make sure tests still pass>
$ hg qfinish -a                     # finalize and promote your patch
to a changeset tracked in the repository
$ hg push central_repo_url   # push your changeset

You can work on several patches at the same time, you can even track
your patches in a mercurial repository. In my experience, it helps
keeping a revision tree clean and avoid quite a few unnecessary
merges. Of course there is also the "rebase" command and some other
extensions I haven't tried such as pbranch but the standard "mq"
extension is itself very useful.

Just my two cents.
Regards,
Adrien.



More information about the Pypy-dev mailing list