Comments
Patch
@@ -31,10 +31,12 @@ class pushoperation(object):
self.force = force
# revs to be pushed (None is "all")
self.revs = revs
# allow push of new branch
self.newbranch = newbranch
+ # did a local lock get acquired?
+ self.locallocked = None
def push(repo, remote, force=False, revs=None, newbranch=False):
'''Push outgoing changesets (limited by revs) from a local
repository to remote. Return an integer:
- None means nothing to push
@@ -64,11 +66,11 @@ def push(repo, remote, force=False, revs
if not pushop.remote.canpush():
raise util.Abort(_("destination does not support push"))
unfi = pushop.repo.unfiltered()
def localphasemove(nodes, phase=phases.public):
"""move <nodes> to <phase> in the local source repo"""
- if locallock is not None:
+ if pushop.locallocked:
phases.advanceboundary(pushop.repo, phase, nodes)
else:
# repo is not locked, do not change any phases!
# Informs the user that phases should have been moved when
# applicable.
@@ -79,11 +81,13 @@ def push(repo, remote, force=False, revs
'local %s phase update\n') % phasestr)
# get local lock as we might write phase data
locallock = None
try:
locallock = pushop.repo.lock()
+ pushop.locallocked = True
except IOError, err:
+ pushop.locallocked = False
if err.errno != errno.EACCES:
raise
# source repo cannot be locked.
# We do not abort the push, but just disable the local phase
# synchronisation.