# HG changeset patch # User Mads Kiilerich # Date 1326413947 -3600 # Node ID 7eca9db689d63cc616872b82ae53e24c3084a0ec # Parent 2305baff673f8ae8e4e61a4dc529f2dc8cbe9574 debugbuilddag: lock repo before starting transaction diff -r 2305baff673f -r 7eca9db689d6 mercurial/commands.py --- a/mercurial/commands.py Fri Jan 13 01:19:07 2012 +0100 +++ b/mercurial/commands.py Fri Jan 13 01:19:07 2012 +0100 @@ -1368,8 +1368,10 @@ tags = [] - tr = repo.transaction("builddag") + lock = tr = None try: + lock = repo.lock() + tr = repo.transaction("builddag") at = -1 atbranch = 'default' @@ -1445,12 +1447,12 @@ atbranch = data ui.progress(_('building'), id, unit=_('revisions'), total=total) tr.close() + + if tags: + repo.opener.write("localtags", "".join(tags)) finally: ui.progress(_('building'), None) - tr.release() - - if tags: - repo.opener.write("localtags", "".join(tags)) + release(tr, lock) @command('debugbundle', [('a', 'all', None, _('show all details'))], _('FILE')) def debugbundle(ui, bundlepath, all=None, **opts):