Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 15875:7eca9db689d6
debugbuilddag: lock repo before starting transaction
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Fri, 13 Jan 2012 01:19:07 +0100 |
parents | d0f2a89c8cfa |
children | afd459933d5f |
comparison
equal
deleted
inserted
replaced
15874:2305baff673f | 15875:7eca9db689d6 |
---|---|
1366 initialmergedlines = [str(i) for i in xrange(0, total * linesperrev)] | 1366 initialmergedlines = [str(i) for i in xrange(0, total * linesperrev)] |
1367 initialmergedlines.append("") | 1367 initialmergedlines.append("") |
1368 | 1368 |
1369 tags = [] | 1369 tags = [] |
1370 | 1370 |
1371 tr = repo.transaction("builddag") | 1371 lock = tr = None |
1372 try: | 1372 try: |
1373 lock = repo.lock() | |
1374 tr = repo.transaction("builddag") | |
1373 | 1375 |
1374 at = -1 | 1376 at = -1 |
1375 atbranch = 'default' | 1377 atbranch = 'default' |
1376 nodeids = [] | 1378 nodeids = [] |
1377 ui.progress(_('building'), 0, unit=_('revisions'), total=total) | 1379 ui.progress(_('building'), 0, unit=_('revisions'), total=total) |
1443 elif type == 'a': | 1445 elif type == 'a': |
1444 ui.note('branch %s\n' % data) | 1446 ui.note('branch %s\n' % data) |
1445 atbranch = data | 1447 atbranch = data |
1446 ui.progress(_('building'), id, unit=_('revisions'), total=total) | 1448 ui.progress(_('building'), id, unit=_('revisions'), total=total) |
1447 tr.close() | 1449 tr.close() |
1450 | |
1451 if tags: | |
1452 repo.opener.write("localtags", "".join(tags)) | |
1448 finally: | 1453 finally: |
1449 ui.progress(_('building'), None) | 1454 ui.progress(_('building'), None) |
1450 tr.release() | 1455 release(tr, lock) |
1451 | |
1452 if tags: | |
1453 repo.opener.write("localtags", "".join(tags)) | |
1454 | 1456 |
1455 @command('debugbundle', [('a', 'all', None, _('show all details'))], _('FILE')) | 1457 @command('debugbundle', [('a', 'all', None, _('show all details'))], _('FILE')) |
1456 def debugbundle(ui, bundlepath, all=None, **opts): | 1458 def debugbundle(ui, bundlepath, all=None, **opts): |
1457 """lists the contents of a bundle""" | 1459 """lists the contents of a bundle""" |
1458 f = url.open(ui, bundlepath) | 1460 f = url.open(ui, bundlepath) |