[PATCH] 1321 (partial): run Python pretxnchangegroup hooks before disk flush

Matt Mackall mpm at selenic.com
Fri Jan 16 07:58:39 CST 2009


On Fri, 2009-01-16 at 13:14 +0100, Gilles Moris wrote:
> On Fri January 16 2009 10:10:11 Doug Philips wrote:
> > One of us is confused. If the changeset is not visible, how can 'pull' or 'incoming' or anything else see it?
> > That is the beauty of the way the repo is updated, with the beauty mark/blemish being that the changeset might be rejected, but is still visible for pulling, etc.
> > 
> 
> Hum! After checking, the pull is not possible during the transaction hook, as there is a lock on the repo.

Incorrect. There is a lock, but it has no effect on pull.

The Mercurial locking model is: writers lock to prevent conflict with
other writers, readers have no locking whatsoever.

Instead readers synchronize with writers through a single monotonically
increasing counter, updated at the very end of commit. This counter is
better known as the revision number of tip.

This lets us have an unlimited number of simultaneous readers even when
a commit is in progress.

There's one exception to this: local clone with symlinks, which takes a
write lock even though it is a 'read-only' operation in principle.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list