##// END OF EJS Templates
bundle2: add op.gettransaction() to handlers that need the lock...
Durham Goode -
r26565:ee1bcb9a default
parent child Browse files
Show More
@@ -1374,6 +1374,9 b' def handlecheckheads(op, inpart):'
1374 heads.append(h)
1374 heads.append(h)
1375 h = inpart.read(20)
1375 h = inpart.read(20)
1376 assert not h
1376 assert not h
1377 # Trigger a transaction so that we are guaranteed to have the lock now.
1378 if op.ui.configbool('experimental', 'bundle2lazylocking'):
1379 op.gettransaction()
1377 if heads != op.repo.heads():
1380 if heads != op.repo.heads():
1378 raise error.PushRaced('repository changed while pushing - '
1381 raise error.PushRaced('repository changed while pushing - '
1379 'please try again')
1382 'please try again')
@@ -1442,6 +1445,10 b' def handlepushkey(op, inpart):'
1442 key = dec(inpart.params['key'])
1445 key = dec(inpart.params['key'])
1443 old = dec(inpart.params['old'])
1446 old = dec(inpart.params['old'])
1444 new = dec(inpart.params['new'])
1447 new = dec(inpart.params['new'])
1448 # Grab the transaction to ensure that we have the lock before performing the
1449 # pushkey.
1450 if op.ui.configbool('experimental', 'bundle2lazylocking'):
1451 op.gettransaction()
1445 ret = op.repo.pushkey(namespace, key, old, new)
1452 ret = op.repo.pushkey(namespace, key, old, new)
1446 record = {'namespace': namespace,
1453 record = {'namespace': namespace,
1447 'key': key,
1454 'key': key,
@@ -1497,6 +1504,9 b' def handlehgtagsfnodes(op, inpart):'
1497
1504
1498 Payload is pairs of 20 byte changeset nodes and filenodes.
1505 Payload is pairs of 20 byte changeset nodes and filenodes.
1499 """
1506 """
1507 # Grab the transaction so we ensure that we have the lock at this point.
1508 if op.ui.configbool('experimental', 'bundle2lazylocking'):
1509 op.gettransaction()
1500 cache = tags.hgtagsfnodescache(op.repo.unfiltered())
1510 cache = tags.hgtagsfnodescache(op.repo.unfiltered())
1501
1511
1502 count = 0
1512 count = 0
General Comments 0
You need to be logged in to leave comments. Login now