[Numpy-discussion] DVCS at PyCon

Martin Geisler mg@lazybytes....
Mon Apr 13 03:03:47 CDT 2009


Ondrej Certik <ondrej@certik.cz> writes:

> Plus with git, you can fetch the remote repository with all the
> branches and browse them locally in your remote branches, when you are
> offline. And merge them with your own branches. In mercurial, it seems
> the only way to see what changes are there and which branch and which
> commits I want to merge is to use "hg in", but that requires the
> internet connection, so it's basically like svn.

No, no, ... I think you're misunderstanding how the history graph works
in Mercurial. It works like it does in Git -- changesets are in a
parent-child relationship. So if I cloned a repository at changeset T:

  ... --- T

I'm free to make new commits:

  ... --- T --- A --- B

And you can do the same:

  ... --- T --- X --- Y --- Z

I can pull in your changesets without disrupting my own work:

            X --- Y --- Z
           /
  ... --- T --- A --- B

Your changesets will be attached to the graph at the point where you
made them, the same for my changesets. I don't have to merge at this
point, instead I can continue with my work even though the repository
has multiple heads (changesets with no childre). So I make C:

            X
           /
  ... --- T --- A --- B --- C

I might now decide that I like your X, Y changesets but not Z, so I
merge them Y into my line of work to create D:

            X --- Y --- Z
           /       \
  ... --- T         `---- D
           \             /
            A --- B --- C

or I might decide that I don't need your changesets and discard them by
cloning or by the strip command from mq (one or the other):

  hg clone -r C repo repo-with-C
  hg strip X

The result is a repository that has only the history up to C:

  ... --- T --- A --- B --- C

So I think it's nonsense to say that Mercurial is like Subversion here:
you pull in changesets when online and you can make new commits, merge
commits, delete commits while offline.

Git has the advantage that it names these branches in a nice way, and
you can work with these names across the network. The bookmarks
extension for Mercurial is inspired by this and lets you attach local
names to heads in the graph.

> I don't know if mercurial has improved in this lately, but at least
> for me, that's a major problem with mercurial.

There has been no improvement lately since Mercurial has worked like
this all the time :-)

-- 
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/e959a91b/attachment.bin 


More information about the Numpy-discussion mailing list