##// END OF EJS Templates
push: move local lock logic in pushoperation...
Pierre-Yves David -
r20436:2f2e8d1c default
parent child Browse files
Show More
@@ -33,6 +33,8 b' class pushoperation(object):'
33 self.revs = revs
33 self.revs = revs
34 # allow push of new branch
34 # allow push of new branch
35 self.newbranch = newbranch
35 self.newbranch = newbranch
36 # did a local lock get acquired?
37 self.locallocked = None
36
38
37 def push(repo, remote, force=False, revs=None, newbranch=False):
39 def push(repo, remote, force=False, revs=None, newbranch=False):
38 '''Push outgoing changesets (limited by revs) from a local
40 '''Push outgoing changesets (limited by revs) from a local
@@ -66,7 +68,7 b' def push(repo, remote, force=False, revs'
66 unfi = pushop.repo.unfiltered()
68 unfi = pushop.repo.unfiltered()
67 def localphasemove(nodes, phase=phases.public):
69 def localphasemove(nodes, phase=phases.public):
68 """move <nodes> to <phase> in the local source repo"""
70 """move <nodes> to <phase> in the local source repo"""
69 if locallock is not None:
71 if pushop.locallocked:
70 phases.advanceboundary(pushop.repo, phase, nodes)
72 phases.advanceboundary(pushop.repo, phase, nodes)
71 else:
73 else:
72 # repo is not locked, do not change any phases!
74 # repo is not locked, do not change any phases!
@@ -81,7 +83,9 b' def push(repo, remote, force=False, revs'
81 locallock = None
83 locallock = None
82 try:
84 try:
83 locallock = pushop.repo.lock()
85 locallock = pushop.repo.lock()
86 pushop.locallocked = True
84 except IOError, err:
87 except IOError, err:
88 pushop.locallocked = False
85 if err.errno != errno.EACCES:
89 if err.errno != errno.EACCES:
86 raise
90 raise
87 # source repo cannot be locked.
91 # source repo cannot be locked.
General Comments 0
You need to be logged in to leave comments. Login now