##// END OF EJS Templates
exchange: don't take wlock if bookmarks are stored in .hg/store/...
Martin von Zweigbergk -
r42513:5d4ec64a default
parent child Browse files
Show More
@@ -539,10 +539,12 b' def push(repo, remote, force=False, revs'
539 # get lock as we might write phase data
539 # get lock as we might write phase data
540 wlock = lock = None
540 wlock = lock = None
541 try:
541 try:
542 # bundle2 push may receive a reply bundle touching bookmarks or other
542 # bundle2 push may receive a reply bundle touching bookmarks
543 # things requiring the wlock. Take it now to ensure proper ordering.
543 # requiring the wlock. Take it now to ensure proper ordering.
544 maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback')
544 maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback')
545 if (not _forcebundle1(pushop)) and maypushback:
545 if ((not _forcebundle1(pushop)) and
546 maypushback and
547 not bookmod.bookmarksinstore(repo)):
546 wlock = pushop.repo.wlock()
548 wlock = pushop.repo.wlock()
547 lock = pushop.repo.lock()
549 lock = pushop.repo.lock()
548 pushop.trmanager = transactionmanager(pushop.repo,
550 pushop.trmanager = transactionmanager(pushop.repo,
@@ -1548,7 +1550,10 b' def pull(repo, remote, heads=None, force'
1548 raise error.Abort(msg)
1550 raise error.Abort(msg)
1549
1551
1550 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
1552 pullop.trmanager = transactionmanager(repo, 'pull', remote.url())
1551 with repo.wlock(), repo.lock(), pullop.trmanager:
1553 wlock = util.nullcontextmanager()
1554 if not bookmod.bookmarksinstore(repo):
1555 wlock = repo.wlock()
1556 with wlock, repo.lock(), pullop.trmanager:
1552 # Use the modern wire protocol, if available.
1557 # Use the modern wire protocol, if available.
1553 if remote.capable('command-changesetdata'):
1558 if remote.capable('command-changesetdata'):
1554 exchangev2.pull(pullop)
1559 exchangev2.pull(pullop)
@@ -2395,7 +2400,8 b' def unbundle(repo, cg, heads, source, ur'
2395 try:
2400 try:
2396 def gettransaction():
2401 def gettransaction():
2397 if not lockandtr[2]:
2402 if not lockandtr[2]:
2398 lockandtr[0] = repo.wlock()
2403 if not bookmod.bookmarksinstore(repo):
2404 lockandtr[0] = repo.wlock()
2399 lockandtr[1] = repo.lock()
2405 lockandtr[1] = repo.lock()
2400 lockandtr[2] = repo.transaction(source)
2406 lockandtr[2] = repo.transaction(source)
2401 lockandtr[2].hookargs['source'] = source
2407 lockandtr[2].hookargs['source'] = source
General Comments 0
You need to be logged in to leave comments. Login now