Patchwork D390: exchange: drop now-unnecessary "local" from lock name variables

login
register
mail settings
Submitter phabricator
Date Aug. 14, 2017, 11:46 p.m.
Message ID <differential-rev-PHID-DREV-67xyqclrkk6cuduhsb2d-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22985/
State Superseded
Headers show

Comments

phabricator - Aug. 14, 2017, 11:46 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Since https://phab.mercurial-scm.org/rHGfda0867cfe03ebf457c12b7e0ff1b174aeb67759 (exchange: drop support for lock-based unbundling
  (BC), 2017-08-06), there is no more remote locking.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D390

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -438,17 +438,17 @@ 
         raise error.Abort(_('cannot push: destination does not support the '
                             'unbundle wire protocol command'))
 
-    # get local lock as we might write phase data
-    localwlock = locallock = None
-    locallocked = False
+    # get lock as we might write phase data
+    wlock = lock = None
+    locked = False
     try:
         # bundle2 push may receive a reply bundle touching bookmarks or other
         # things requiring the wlock. Take it now to ensure proper ordering.
         maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback')
         if (not _forcebundle1(pushop)) and maypushback:
-            localwlock = pushop.repo.wlock()
-        locallock = pushop.repo.lock()
-        locallocked = True
+            wlock = pushop.repo.wlock()
+        lock = pushop.repo.lock()
+        locked = True
     except IOError as err:
         if err.errno != errno.EACCES:
             raise
@@ -458,7 +458,7 @@ 
         msg = 'cannot lock source repository: %s\n' % err
         pushop.ui.debug(msg)
     try:
-        if locallocked:
+        if locked:
             pushop.trmanager = transactionmanager(pushop.repo,
                                                   'push-response',
                                                   pushop.remote.url())
@@ -476,10 +476,10 @@ 
     finally:
         if pushop.trmanager:
             pushop.trmanager.release()
-        if locallock is not None:
-            locallock.release()
-        if localwlock is not None:
-            localwlock.release()
+        if lock is not None:
+            lock.release()
+        if wlock is not None:
+            wlock.release()
 
     return pushop