##// END OF EJS Templates
amend: disable hooks when creating intermediate commit (issue3501)
Idan Kamara -
r17049:24408224 stable
parent child Browse files
Show More
@@ -1301,7 +1301,11 b' def amend(ui, repo, commitfunc, old, ext'
1301 1301 try:
1302 1302 # First, do a regular commit to record all changes in the working
1303 1303 # directory (if there are any)
1304 node = commit(ui, repo, commitfunc, pats, opts)
1304 ui.callhooks = False
1305 try:
1306 node = commit(ui, repo, commitfunc, pats, opts)
1307 finally:
1308 ui.callhooks = True
1305 1309 ctx = repo[node]
1306 1310
1307 1311 # Participating changesets:
@@ -25,11 +25,17 b' Nothing to amend:'
25 25 nothing changed
26 26 [1]
27 27
28 $ echo '[hooks]' >> $HGRCPATH
29 $ echo 'pretxncommit.foo = echo "pretxncommit $HG_NODE"; hg id -r $HG_NODE' >> $HGRCPATH
30
28 31 Amending changeset with changes in working dir:
29 32
30 33 $ echo a >> a
31 34 $ hg ci --amend -m 'amend base1'
35 pretxncommit 9cd25b479c51be2f4ed2c38e7abdf7ce67d8e0dc
36 9cd25b479c51 tip
32 37 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg
38 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
33 39 $ hg diff -c .
34 40 diff -r ad120869acf0 -r 9cd25b479c51 a
35 41 --- a/a Thu Jan 01 00:00:00 1970 +0000
General Comments 0
You need to be logged in to leave comments. Login now