# HG changeset patch # User Matt Mackall # Date 2009-05-14 18:21:20 # Node ID 4d5916358abd60c42a4bd395734e330db4ea5823 # Parent 1d11d985c179283727e1fb0cbebe0528f0bde300 commit: move lots of commitctx outside of the repo lock diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -826,29 +826,29 @@ class localrepository(repo.repository): If working is set, the working directory is affected. """ - lock = self.lock() tr = None valid = 0 # don't save the dirstate if this isn't set - try: - commit = sorted(ctx.modified() + ctx.added()) - remove = ctx.removed() - extra = ctx.extra().copy() - branchname = extra['branch'] - user = ctx.user() - text = ctx.description() + lock = None + commit = sorted(ctx.modified() + ctx.added()) + remove = ctx.removed() + extra = ctx.extra().copy() + branchname = extra['branch'] + user = ctx.user() + text = ctx.description() - p1, p2 = [p.node() for p in ctx.parents()] - c1 = self.changelog.read(p1) - c2 = self.changelog.read(p2) - m1 = self.manifest.read(c1[0]).copy() - m2 = self.manifest.read(c2[0]) + p1, p2 = [p.node() for p in ctx.parents()] + c1 = self.changelog.read(p1) + c2 = self.changelog.read(p2) + m1 = self.manifest.read(c1[0]).copy() + m2 = self.manifest.read(c2[0]) - xp1 = hex(p1) - if p2 == nullid: xp2 = '' - else: xp2 = hex(p2) + xp1 = hex(p1) + if p2 == nullid: xp2 = '' + else: xp2 = hex(p2) + self.hook("precommit", throw=True, parent1=xp1, parent2=xp2) - self.hook("precommit", throw=True, parent1=xp1, parent2=xp2) - + lock = self.lock() + try: tr = self.transaction() trp = weakref.proxy(tr)