Show More
@@ -10,7 +10,7 b' from i18n import _' | |||||
10 | import os, sys, errno, re, tempfile |
|
10 | import os, sys, errno, re, tempfile | |
11 | import util, scmutil, templater, patch, error, templatekw, revlog, copies |
|
11 | import util, scmutil, templater, patch, error, templatekw, revlog, copies | |
12 | import match as matchmod |
|
12 | import match as matchmod | |
13 | import subrepo, context, repair, bookmarks, graphmod, revset |
|
13 | import subrepo, context, repair, bookmarks, graphmod, revset, phases | |
14 |
|
14 | |||
15 | def parsealiases(cmd): |
|
15 | def parsealiases(cmd): | |
16 | return cmd.lstrip("^").split("|") |
|
16 | return cmd.lstrip("^").split("|") | |
@@ -1675,7 +1675,12 b' def amend(ui, repo, commitfunc, old, ext' | |||||
1675 | user=user, |
|
1675 | user=user, | |
1676 | date=date, |
|
1676 | date=date, | |
1677 | extra=extra) |
|
1677 | extra=extra) | |
1678 | newid = repo.commitctx(new) |
|
1678 | ph = repo.ui.config('phases', 'new-commit', phases.draft) | |
|
1679 | try: | |||
|
1680 | repo.ui.setconfig('phases', 'new-commit', old.phase()) | |||
|
1681 | newid = repo.commitctx(new) | |||
|
1682 | finally: | |||
|
1683 | repo.ui.setconfig('phases', 'new-commit', ph) | |||
1679 | if newid != old.node(): |
|
1684 | if newid != old.node(): | |
1680 | # Reroute the working copy parent to the new changeset |
|
1685 | # Reroute the working copy parent to the new changeset | |
1681 | repo.setparents(newid, nullid) |
|
1686 | repo.setparents(newid, nullid) |
@@ -25,7 +25,7 b' Nothing to amend:' | |||||
25 |
|
25 | |||
26 | $ cat >> $HGRCPATH <<EOF |
|
26 | $ cat >> $HGRCPATH <<EOF | |
27 | > [hooks] |
|
27 | > [hooks] | |
28 | > pretxncommit.foo = sh -c "echo \"pretxncommit \$HG_NODE\"; hg id -r \$HG_NODE" |
|
28 | > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE" | |
29 | > EOF |
|
29 | > EOF | |
30 |
|
30 | |||
31 | Amending changeset with changes in working dir: |
|
31 | Amending changeset with changes in working dir: | |
@@ -355,3 +355,18 b" first graft something so there's an addi" | |||||
355 | $ hg log -r . --debug | grep extra |
|
355 | $ hg log -r . --debug | grep extra | |
356 | extra: branch=a |
|
356 | extra: branch=a | |
357 | extra: source=2647734878ef0236dda712fae9c1651cf694ea8a |
|
357 | extra: source=2647734878ef0236dda712fae9c1651cf694ea8a | |
|
358 | ||||
|
359 | Preserve phase | |||
|
360 | ||||
|
361 | $ hg phase '.^::.' | |||
|
362 | 11: draft | |||
|
363 | 13: draft | |||
|
364 | $ hg phase --secret --force . | |||
|
365 | $ hg phase '.^::.' | |||
|
366 | 11: draft | |||
|
367 | 13: secret | |||
|
368 | $ hg commit --amend -m 'amend for phase' -q | |||
|
369 | $ hg phase '.^::.' | |||
|
370 | 11: draft | |||
|
371 | 13: secret | |||
|
372 |
@@ -13,7 +13,7 b'' | |||||
13 | > patterns=glob:**.dat |
|
13 | > patterns=glob:**.dat | |
14 | > usercache=${USERCACHE} |
|
14 | > usercache=${USERCACHE} | |
15 | > [hooks] |
|
15 | > [hooks] | |
16 | > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status" |
|
16 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" | |
17 | > EOF |
|
17 | > EOF | |
18 |
|
18 | |||
19 | Create the repo with a couple of revisions of both large and normal |
|
19 | Create the repo with a couple of revisions of both large and normal | |
@@ -434,7 +434,7 b' Test 3364' | |||||
434 | $ cd ../addrm |
|
434 | $ cd ../addrm | |
435 | $ cat >> .hg/hgrc <<EOF |
|
435 | $ cat >> .hg/hgrc <<EOF | |
436 | > [hooks] |
|
436 | > [hooks] | |
437 | > post-commit.stat=sh -c "echo \"Invoking status postcommit hook\"; hg status -A" |
|
437 | > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A" | |
438 | > EOF |
|
438 | > EOF | |
439 | $ touch foo |
|
439 | $ touch foo | |
440 | $ hg add --large foo |
|
440 | $ hg add --large foo |
General Comments 0
You need to be logged in to leave comments.
Login now