##// END OF EJS Templates
push: elevate phase transaction to cover entire operation...
Eric Sumner -
r23437:94e2862d default
parent child Browse files
Show More
@@ -104,6 +104,8 b' class pushoperation(object):'
104 self.outobsmarkers = set()
104 self.outobsmarkers = set()
105 # outgoing bookmarks
105 # outgoing bookmarks
106 self.outbookmarks = []
106 self.outbookmarks = []
107 # transaction manager
108 self.trmanager = None
107
109
108 @util.propertycache
110 @util.propertycache
109 def futureheads(self):
111 def futureheads(self):
@@ -204,6 +206,10 b' def push(repo, remote, force=False, revs'
204 msg = 'cannot lock source repository: %s\n' % err
206 msg = 'cannot lock source repository: %s\n' % err
205 pushop.ui.debug(msg)
207 pushop.ui.debug(msg)
206 try:
208 try:
209 if pushop.locallocked:
210 pushop.trmanager = transactionmanager(repo,
211 'push-response',
212 pushop.remote.url())
207 pushop.repo.checkpush(pushop)
213 pushop.repo.checkpush(pushop)
208 lock = None
214 lock = None
209 unbundle = pushop.remote.capable('unbundle')
215 unbundle = pushop.remote.capable('unbundle')
@@ -222,7 +228,11 b' def push(repo, remote, force=False, revs'
222 finally:
228 finally:
223 if lock is not None:
229 if lock is not None:
224 lock.release()
230 lock.release()
231 if pushop.trmanager:
232 pushop.trmanager.close()
225 finally:
233 finally:
234 if pushop.trmanager:
235 pushop.trmanager.release()
226 if locallock is not None:
236 if locallock is not None:
227 locallock.release()
237 locallock.release()
228
238
@@ -693,13 +703,11 b' def _pushsyncphase(pushop):'
693
703
694 def _localphasemove(pushop, nodes, phase=phases.public):
704 def _localphasemove(pushop, nodes, phase=phases.public):
695 """move <nodes> to <phase> in the local source repo"""
705 """move <nodes> to <phase> in the local source repo"""
696 if pushop.locallocked:
706 if pushop.trmanager:
697 tr = pushop.repo.transaction('push-phase-sync')
707 phases.advanceboundary(pushop.repo,
698 try:
708 pushop.trmanager.transaction(),
699 phases.advanceboundary(pushop.repo, tr, phase, nodes)
709 phase,
700 tr.close()
710 nodes)
701 finally:
702 tr.release()
703 else:
711 else:
704 # repo is not locked, do not change any phases!
712 # repo is not locked, do not change any phases!
705 # Informs the user that phases should have been moved when
713 # Informs the user that phases should have been moved when
@@ -176,6 +176,9 b' push'
176 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
176 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
177 remote: 1 new obsolescence markers
177 remote: 1 new obsolescence markers
178 updating bookmark book_eea1
178 updating bookmark book_eea1
179 pre-close-tip:02de42196ebe draft book_02de
180 postclose-tip:02de42196ebe draft book_02de
181 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=file:$TESTTMP/other
179 $ hg -R other log -G
182 $ hg -R other log -G
180 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
183 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
181 |\
184 |\
@@ -254,6 +257,9 b' push over ssh'
254 remote: postclose-tip:5fddd98957c8 draft book_5fdd
257 remote: postclose-tip:5fddd98957c8 draft book_5fdd
255 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
258 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
256 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
259 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
260 pre-close-tip:02de42196ebe draft book_02de
261 postclose-tip:02de42196ebe draft book_02de
262 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=ssh://user@dummy/other
257 $ hg -R other log -G
263 $ hg -R other log -G
258 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
264 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
259 |
265 |
@@ -292,6 +298,9 b' push over http'
292 remote: added 1 changesets with 1 changes to 1 files
298 remote: added 1 changesets with 1 changes to 1 files
293 remote: 1 new obsolescence markers
299 remote: 1 new obsolescence markers
294 updating bookmark book_32af
300 updating bookmark book_32af
301 pre-close-tip:02de42196ebe draft book_02de
302 postclose-tip:02de42196ebe draft book_02de
303 b2x-transactionclose hook: HG_SOURCE=push-response HG_URL=http://localhost:$HGPORT2/
295 $ cat other-error.log
304 $ cat other-error.log
296
305
297 Check final content.
306 Check final content.
General Comments 0
You need to be logged in to leave comments. Login now