##// END OF EJS Templates
push: acquire local 'wlock' if "pushback" is expected (BC) (issue4596)...
Pierre-Yves David -
r24754:5dc5cd7a default
parent child Browse files
Show More
@@ -201,8 +201,13 b' def push(repo, remote, force=False, revs'
201 if not pushop.remote.canpush():
201 if not pushop.remote.canpush():
202 raise util.Abort(_("destination does not support push"))
202 raise util.Abort(_("destination does not support push"))
203 # get local lock as we might write phase data
203 # get local lock as we might write phase data
204 locallock = None
204 localwlock = locallock = None
205 try:
205 try:
206 # bundle2 push may receive a reply bundle touching bookmarks or other
207 # things requiring the wlock. Take it now to ensure proper ordering.
208 maypushback = pushop.ui.configbool('experimental', 'bundle2.pushback')
209 if _canusebundle2(pushop) and maypushback:
210 localwlock = pushop.repo.wlock()
206 locallock = pushop.repo.lock()
211 locallock = pushop.repo.lock()
207 pushop.locallocked = True
212 pushop.locallocked = True
208 except IOError, err:
213 except IOError, err:
@@ -242,6 +247,8 b' def push(repo, remote, force=False, revs'
242 pushop.trmanager.release()
247 pushop.trmanager.release()
243 if locallock is not None:
248 if locallock is not None:
244 locallock.release()
249 locallock.release()
250 if localwlock is not None:
251 localwlock.release()
245
252
246 return pushop
253 return pushop
247
254
@@ -91,7 +91,6 b' With config'
91 $ hg push
91 $ hg push
92 pushing to ssh://user@dummy/server
92 pushing to ssh://user@dummy/server
93 searching for changes
93 searching for changes
94 "wlock" acquired after "lock" at: */mercurial/bookmarks.py:259 (pushbookmark) (glob)
95 remote: adding changesets
94 remote: adding changesets
96 remote: adding manifests
95 remote: adding manifests
97 remote: adding file changes
96 remote: adding file changes
General Comments 0
You need to be logged in to leave comments. Login now