[Numpy-discussion] DVCS at PyCon

Martin Geisler mg@lazybytes....
Mon Apr 13 09:02:24 CDT 2009

David Cournapeau <cournape@gmail.com> writes:

> On Mon, Apr 13, 2009 at 6:22 PM, Martin Geisler <mg@lazybytes.net> wrote:
>>  hg diff -r F -r tip
>> where 'tip' is a built-in name that always point to the newest
>> revision in a repository. If you have a bookmark named 'numpy-1.2.x'
>> on F you could write:
>>  hg diff -r numpy-1.2.x -r tip
> Ok, so bookmarks are like named branches in that regard.

Yeah, sort of. Bookmarks are actually more like tags: both concepts
allow you to give a changeset a friendly name.

Named branches are slightly different: they allow you to stamp a
friendly name on a changeset, but not on just one changeset -- all
changesets in the named branch get the stamp. The branch name can be
used in operations like 'hg update', 'hg diff', etc, and will resolve to
the tip-most changeset on the branch.

> But what if they happened to be in different repositories ? If you
> have two clones, how do you refer one clone from the other ? That's
> where bzr UI for branch handling broke IMHO, so I was wondering about
> hg ?

You're right, the UI is not so good. In particular, you cannot use 'hg
diff' to compare repositories. The rdiff extension does this, though:


Using stock Mercurial you can use 'hg incoming -p' to see the patches of
the incoming (missing) changesets, or you can pull in the changesets and
then look at them -- if you don't like them you can remove them again.

>> At the moment, bookmarks are even local to a repository, but it is
>> planned to add support for looking them up remotely and for
>> transferring them on push/pull. But right now you cannot tell if I'm
>> using bookmarks to keep track of the heads in my clone.
> So it means that we would have to keep clones for each branch on the
> server at the moment, right ?

Yes, that would be easiest. The bookmarks are stored in a plain text
file (.hg/bookmarks) which can be copied around, but the bookmarks will
only update themselves upon commit when they point to a head changeset.

> Can I import this into bookmarks ? Say, we have three numpy branches
> on scipy.org:
> numpy-mainline
> numpy-1.2.x
> numpy-1.3.x
> and I want to keep everything into one repository, each branch being
> bookmark. It looks like it is possible internally from my
> understanding on how it works in hg, but does the UI supports it ?

Right, it is supported -- you would just pull the changesets from each
clone into one clone and this will merge the acyclic graphs into one
graph with all changesets.

You could do this in just your clone, without requiring the numpy server
to do the same. If you do this you'll probably want to attach three
bookmarks in your clone in order to make it easy for yourself to update
From one head to another.

Or you could use named branches for the numpy-1.2.x and numpy-1.3.x
branches -- then everybody would see the branch names when they clone
the combined repository.

Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090413/df11c26d/attachment.bin 

More information about the Numpy-discussion mailing list