[PATCH V2] revert: add support for reverting subrepos

Matt Mackall mpm at selenic.com
Sat Oct 15 10:35:13 CDT 2011


On Sat, 2011-10-15 at 11:28 -0400, Greg Ward wrote:
> On Fri, Oct 14, 2011 at 6:27 PM, Angel Ezquerra
> <angel.ezquerra at gmail.com> wrote:
> >>> +    wlock = repo.wlock()
> >>
> >> This lock should be in the top-level function. Releasing and retaking a
> >> lock in the middle of an operation is just as bad as not taking it all.
> >
> > I don't really know what lock does (though I kind of suspect it) but
> > it'd be nice to get a short explanation :-)
> 
> I had that problem too when I first started hacking on Mercurial. So I
> wrote some docstrings, sent in patches with the docs, and
> hey-what-do-you-know, localrepository.lock() and wlock() are now
> usefully documented. Writing docstring patches is an excellent way to
> learn your way around the code *and* earn brownie points.

Locking is also documented here:

http://mercurial.selenic.com/wiki/LockingDesign

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list