##// END OF EJS Templates
localrepo: put bookmark move following commit in one transaction...
Laurent Charignon -
r26998:4414d500 default
parent child Browse files
Show More
@@ -1455,8 +1455,9 b' class localrepository(object):'
1455 match.explicitdir = vdirs.append
1455 match.explicitdir = vdirs.append
1456 match.bad = fail
1456 match.bad = fail
1457
1457
1458 wlock = self.wlock()
1458 wlock = lock = tr = None
1459 try:
1459 try:
1460 wlock = self.wlock()
1460 wctx = self[None]
1461 wctx = self[None]
1461 merge = len(wctx.parents()) > 1
1462 merge = len(wctx.parents()) > 1
1462
1463
@@ -1591,23 +1592,26 b' class localrepository(object):'
1591 subrepo.writestate(self, newstate)
1592 subrepo.writestate(self, newstate)
1592
1593
1593 p1, p2 = self.dirstate.parents()
1594 p1, p2 = self.dirstate.parents()
1595 lock = self.lock()
1594 hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '')
1596 hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '')
1595 try:
1597 try:
1596 self.hook("precommit", throw=True, parent1=hookp1,
1598 self.hook("precommit", throw=True, parent1=hookp1,
1597 parent2=hookp2)
1599 parent2=hookp2)
1600 tr = self.transaction('commit')
1598 ret = self.commitctx(cctx, True)
1601 ret = self.commitctx(cctx, True)
1599 except: # re-raises
1602 except: # re-raises
1600 if edited:
1603 if edited:
1601 self.ui.write(
1604 self.ui.write(
1602 _('note: commit message saved in %s\n') % msgfn)
1605 _('note: commit message saved in %s\n') % msgfn)
1603 raise
1606 raise
1604
1605 # update bookmarks, dirstate and mergestate
1607 # update bookmarks, dirstate and mergestate
1606 bookmarks.update(self, [p1, p2], ret)
1608 bookmarks.update(self, [p1, p2], ret)
1607 cctx.markcommitted(ret)
1609 cctx.markcommitted(ret)
1608 ms.reset()
1610 ms.reset()
1611 tr.close()
1612
1609 finally:
1613 finally:
1610 wlock.release()
1614 lockmod.release(tr, lock, wlock)
1611
1615
1612 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
1616 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
1613 # hack for command that use a temporary commit (eg: histedit)
1617 # hack for command that use a temporary commit (eg: histedit)
@@ -96,6 +96,7 b' Non store repo:'
96 .hg/phaseroots
96 .hg/phaseroots
97 .hg/requires
97 .hg/requires
98 .hg/undo
98 .hg/undo
99 .hg/undo.backup.dirstate
99 .hg/undo.backupfiles
100 .hg/undo.backupfiles
100 .hg/undo.bookmarks
101 .hg/undo.bookmarks
101 .hg/undo.branch
102 .hg/undo.branch
@@ -132,6 +133,7 b' Non fncache repo:'
132 .hg/store/undo
133 .hg/store/undo
133 .hg/store/undo.backupfiles
134 .hg/store/undo.backupfiles
134 .hg/store/undo.phaseroots
135 .hg/store/undo.phaseroots
136 .hg/undo.backup.dirstate
135 .hg/undo.bookmarks
137 .hg/undo.bookmarks
136 .hg/undo.branch
138 .hg/undo.branch
137 .hg/undo.desc
139 .hg/undo.desc
@@ -223,6 +225,7 b' Aborting lock does not prevent fncache w'
223 $ touch y
225 $ touch y
224 $ hg ci -qAm y
226 $ hg ci -qAm y
225 abort: forced lock failure
227 abort: forced lock failure
228 Exception mercurial.error.Abort: Abort('forced lock failure',) in <bound method lock.__del__ of <mercurial.lock.lock object at *>> ignored (glob)
226 [255]
229 [255]
227 $ cat .hg/store/fncache
230 $ cat .hg/store/fncache
228 data/y.i
231 data/y.i
@@ -229,6 +229,7 b' r4 has hardlinks in the working dir (not'
229 2 r4/.hg/store/undo.backup.phaseroots
229 2 r4/.hg/store/undo.backup.phaseroots
230 2 r4/.hg/store/undo.backupfiles
230 2 r4/.hg/store/undo.backupfiles
231 2 r4/.hg/store/undo.phaseroots
231 2 r4/.hg/store/undo.phaseroots
232 2 r4/.hg/undo.backup.dirstate
232 2 r4/.hg/undo.bookmarks
233 2 r4/.hg/undo.bookmarks
233 2 r4/.hg/undo.branch
234 2 r4/.hg/undo.branch
234 2 r4/.hg/undo.desc
235 2 r4/.hg/undo.desc
@@ -264,6 +265,7 b' Update back to revision 11 in r4 should '
264 2 r4/.hg/store/undo.backup.phaseroots
265 2 r4/.hg/store/undo.backup.phaseroots
265 2 r4/.hg/store/undo.backupfiles
266 2 r4/.hg/store/undo.backupfiles
266 2 r4/.hg/store/undo.phaseroots
267 2 r4/.hg/store/undo.phaseroots
268 2 r4/.hg/undo.backup.dirstate
267 2 r4/.hg/undo.bookmarks
269 2 r4/.hg/undo.bookmarks
268 2 r4/.hg/undo.branch
270 2 r4/.hg/undo.branch
269 2 r4/.hg/undo.desc
271 2 r4/.hg/undo.desc
@@ -364,9 +364,9 b' check saving last-message.txt, at first'
364 HG: branch 'default'
364 HG: branch 'default'
365 HG: added f
365 HG: added f
366 ====
366 ====
367 note: commit message saved in .hg/last-message.txt
367 transaction abort!
368 transaction abort!
368 rollback completed
369 rollback completed
369 note: commit message saved in .hg/last-message.txt
370 abort: pretxncommit.unexpectedabort hook exited with status 1
370 abort: pretxncommit.unexpectedabort hook exited with status 1
371 [255]
371 [255]
372 $ cat .hg/last-message.txt
372 $ cat .hg/last-message.txt
@@ -388,9 +388,9 b' action)'
388 HG: user: test
388 HG: user: test
389 HG: branch 'default'
389 HG: branch 'default'
390 HG: added f
390 HG: added f
391 note: commit message saved in .hg/last-message.txt
391 transaction abort!
392 transaction abort!
392 rollback completed
393 rollback completed
393 note: commit message saved in .hg/last-message.txt
394 abort: pretxncommit.unexpectedabort hook exited with status 1
394 abort: pretxncommit.unexpectedabort hook exited with status 1
395 [255]
395 [255]
396
396
@@ -83,6 +83,7 b' new directories are setgid'
83 00660 ./.hg/store/undo
83 00660 ./.hg/store/undo
84 00660 ./.hg/store/undo.backupfiles
84 00660 ./.hg/store/undo.backupfiles
85 00660 ./.hg/store/undo.phaseroots
85 00660 ./.hg/store/undo.phaseroots
86 00660 ./.hg/undo.backup.dirstate
86 00660 ./.hg/undo.bookmarks
87 00660 ./.hg/undo.bookmarks
87 00660 ./.hg/undo.branch
88 00660 ./.hg/undo.branch
88 00660 ./.hg/undo.desc
89 00660 ./.hg/undo.desc
@@ -229,9 +229,9 b" and that combination of '--edit' and '--"
229 HG: added aa
229 HG: added aa
230 HG: changed a
230 HG: changed a
231 ====
231 ====
232 note: commit message saved in .hg/last-message.txt
232 transaction abort!
233 transaction abort!
233 rollback completed
234 rollback completed
234 note: commit message saved in .hg/last-message.txt
235 qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
235 qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
236 abort: pretxncommit.unexpectedabort hook exited with status 1
236 abort: pretxncommit.unexpectedabort hook exited with status 1
237 [255]
237 [255]
@@ -299,9 +299,9 b' Test saving last-message.txt'
299 HG: branch 'default'
299 HG: branch 'default'
300 HG: no files changed
300 HG: no files changed
301 ====
301 ====
302 note: commit message saved in .hg/last-message.txt
302 transaction abort!
303 transaction abort!
303 rollback completed
304 rollback completed
304 note: commit message saved in .hg/last-message.txt
305 abort: pretxncommit.unexpectedabort hook exited with status 1
305 abort: pretxncommit.unexpectedabort hook exited with status 1
306 [255]
306 [255]
307 $ cat .hg/last-message.txt
307 $ cat .hg/last-message.txt
@@ -185,9 +185,9 b' Test saving last-message.txt:'
185 HG: branch 'default'
185 HG: branch 'default'
186 HG: added file2
186 HG: added file2
187 ====
187 ====
188 note: commit message saved in .hg/last-message.txt
188 transaction abort!
189 transaction abort!
189 rollback completed
190 rollback completed
190 note: commit message saved in .hg/last-message.txt
191 qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
191 qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
192 abort: pretxncommit.unexpectedabort hook exited with status 1
192 abort: pretxncommit.unexpectedabort hook exited with status 1
193 [255]
193 [255]
@@ -228,9 +228,9 b' external process'
228 0:25e397dabed2
228 0:25e397dabed2
229 A file2
229 A file2
230 ====
230 ====
231 note: commit message saved in .hg/last-message.txt
231 transaction abort!
232 transaction abort!
232 rollback completed
233 rollback completed
233 note: commit message saved in .hg/last-message.txt
234 qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
234 qrefresh interrupted while patch was popped! (revert --all, qpush to recover)
235 abort: pretxncommit.unexpectedabort hook exited with status 1
235 abort: pretxncommit.unexpectedabort hook exited with status 1
236 [255]
236 [255]
@@ -113,9 +113,9 b' same thing, but run $EDITOR'
113 > echo "another precious commit message" > "$1"
113 > echo "another precious commit message" > "$1"
114 > __EOF__
114 > __EOF__
115 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1
115 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1
116 note: commit message saved in .hg/last-message.txt
116 transaction abort!
117 transaction abort!
117 rollback completed
118 rollback completed
118 note: commit message saved in .hg/last-message.txt
119 abort: pretxncommit hook exited with status * (glob)
119 abort: pretxncommit hook exited with status * (glob)
120 [255]
120 [255]
121 $ cat .hg/last-message.txt
121 $ cat .hg/last-message.txt
@@ -272,9 +272,9 b" regardless of '--message')"
272 HG: branch 'tag-and-branch-same-name'
272 HG: branch 'tag-and-branch-same-name'
273 HG: changed .hgtags
273 HG: changed .hgtags
274 ====
274 ====
275 note: commit message saved in .hg/last-message.txt
275 transaction abort!
276 transaction abort!
276 rollback completed
277 rollback completed
277 note: commit message saved in .hg/last-message.txt
278 abort: pretxncommit.unexpectedabort hook exited with status 1
278 abort: pretxncommit.unexpectedabort hook exited with status 1
279 [255]
279 [255]
280 $ cat .hg/last-message.txt
280 $ cat .hg/last-message.txt
General Comments 0
You need to be logged in to leave comments. Login now