##// END OF EJS Templates
hook: protect commit hooks against stripping of temporary commit (issue4422)...
Pierre-Yves David -
r23129:eb315418 stable
parent child Browse files
Show More
@@ -1370,7 +1370,11 b' class localrepository(object):'
1370 wlock.release()
1370 wlock.release()
1371
1371
1372 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
1372 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
1373 self.hook("commit", node=node, parent1=parent1, parent2=parent2)
1373 # hack for command that use a temporary commit (eg: histedit)
1374 # temporary commit got stripped before hook release
1375 if node in self:
1376 self.hook("commit", node=node, parent1=parent1,
1377 parent2=parent2)
1374 self._afterlock(commithook)
1378 self._afterlock(commithook)
1375 return ret
1379 return ret
1376
1380
@@ -446,3 +446,45 b' Folding with initial rename (issue3729)'
446 0:6c795aa153cb a
446 0:6c795aa153cb a
447
447
448 $ cd ..
448 $ cd ..
449
450 Folding with swapping
451 ---------------------
452
453 This is an excuse to test hook with histedit temporary commit (issue4422)
454
455
456 $ hg init issue4422
457 $ cd issue4422
458 $ echo a > a.txt
459 $ hg add a.txt
460 $ hg commit -m a
461 $ echo b > b.txt
462 $ hg add b.txt
463 $ hg commit -m b
464 $ echo c > c.txt
465 $ hg add c.txt
466 $ hg commit -m c
467
468 $ hg logt
469 2:a1a953ffb4b0 c
470 1:199b6bb90248 b
471 0:6c795aa153cb a
472
473 $ hg histedit 6c795aa153cb --config hooks.commit="echo commit \$HG_NODE" --commands - 2>&1 << EOF | fixbundle
474 > pick 199b6bb90248 b
475 > fold a1a953ffb4b0 c
476 > pick 6c795aa153cb a
477 > EOF
478 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
479 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
481 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
482 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 commit 9599899f62c05f4377548c32bf1c9f1a39634b0c
485
486 $ hg logt
487 1:9599899f62c0 a
488 0:79b99e9c8e49 b
489
490 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now