Show More
@@ -438,17 +438,17 b' def push(repo, remote, force=False, revs' | |||||
438 | raise error.Abort(_('cannot push: destination does not support the ' |
|
438 | raise error.Abort(_('cannot push: destination does not support the ' | |
439 | 'unbundle wire protocol command')) |
|
439 | 'unbundle wire protocol command')) | |
440 |
|
440 | |||
441 |
# get loc |
|
441 | # get lock as we might write phase data | |
442 |
|
|
442 | wlock = lock = None | |
443 |
|
|
443 | locked = False | |
444 | try: |
|
444 | try: | |
445 | # bundle2 push may receive a reply bundle touching bookmarks or other |
|
445 | # bundle2 push may receive a reply bundle touching bookmarks or other | |
446 | # things requiring the wlock. Take it now to ensure proper ordering. |
|
446 | # things requiring the wlock. Take it now to ensure proper ordering. | |
447 | maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback') |
|
447 | maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback') | |
448 | if (not _forcebundle1(pushop)) and maypushback: |
|
448 | if (not _forcebundle1(pushop)) and maypushback: | |
449 |
|
|
449 | wlock = pushop.repo.wlock() | |
450 |
|
|
450 | lock = pushop.repo.lock() | |
451 |
|
|
451 | locked = True | |
452 | except IOError as err: |
|
452 | except IOError as err: | |
453 | if err.errno != errno.EACCES: |
|
453 | if err.errno != errno.EACCES: | |
454 | raise |
|
454 | raise | |
@@ -458,7 +458,7 b' def push(repo, remote, force=False, revs' | |||||
458 | msg = 'cannot lock source repository: %s\n' % err |
|
458 | msg = 'cannot lock source repository: %s\n' % err | |
459 | pushop.ui.debug(msg) |
|
459 | pushop.ui.debug(msg) | |
460 | try: |
|
460 | try: | |
461 |
if |
|
461 | if locked: | |
462 | pushop.trmanager = transactionmanager(pushop.repo, |
|
462 | pushop.trmanager = transactionmanager(pushop.repo, | |
463 | 'push-response', |
|
463 | 'push-response', | |
464 | pushop.remote.url()) |
|
464 | pushop.remote.url()) | |
@@ -476,10 +476,10 b' def push(repo, remote, force=False, revs' | |||||
476 | finally: |
|
476 | finally: | |
477 | if pushop.trmanager: |
|
477 | if pushop.trmanager: | |
478 | pushop.trmanager.release() |
|
478 | pushop.trmanager.release() | |
479 |
if |
|
479 | if lock is not None: | |
480 |
|
|
480 | lock.release() | |
481 |
if |
|
481 | if wlock is not None: | |
482 |
|
|
482 | wlock.release() | |
483 |
|
483 | |||
484 | return pushop |
|
484 | return pushop | |
485 |
|
485 |
General Comments 0
You need to be logged in to leave comments.
Login now