Show More
@@ -1582,10 +1582,14 b' def amend(ui, repo, commitfunc, old, ext' | |||
|
1582 | 1582 | lock = repo.lock() |
|
1583 | 1583 | tr = repo.transaction('amend') |
|
1584 | 1584 | try: |
|
1585 | # See if we got a message from -m or -l, if not, open the editor | |
|
1586 | # with the message of the changeset to amend | |
|
1587 | message = logmessage(ui, opts) | |
|
1585 | 1588 | # First, do a regular commit to record all changes in the working |
|
1586 | 1589 | # directory (if there are any) |
|
1587 | 1590 | ui.callhooks = False |
|
1588 | 1591 | try: |
|
1592 | opts['message'] = 'temporary amend commit for %s' % old | |
|
1589 | 1593 | node = commit(ui, repo, commitfunc, pats, opts) |
|
1590 | 1594 | finally: |
|
1591 | 1595 | ui.callhooks = True |
@@ -1618,7 +1622,6 b' def amend(ui, repo, commitfunc, old, ext' | |||
|
1618 | 1622 | |
|
1619 | 1623 | user = ctx.user() |
|
1620 | 1624 | date = ctx.date() |
|
1621 | message = ctx.description() | |
|
1622 | 1625 | # Recompute copies (avoid recording a -> b -> a) |
|
1623 | 1626 | copied = copies.pathcopies(base, ctx) |
|
1624 | 1627 | |
@@ -1663,17 +1666,10 b' def amend(ui, repo, commitfunc, old, ext' | |||
|
1663 | 1666 | except KeyError: |
|
1664 | 1667 | raise IOError |
|
1665 | 1668 | |
|
1666 | # See if we got a message from -m or -l, if not, open the editor | |
|
1667 | # with the message of the changeset to amend | |
|
1668 | 1669 | user = opts.get('user') or old.user() |
|
1669 | 1670 | date = opts.get('date') or old.date() |
|
1670 | message = logmessage(ui, opts) | |
|
1671 |
|
|
|
1672 | cctx = context.workingctx(repo, old.description(), | |
|
1673 | user, date, extra, | |
|
1674 | repo.status(base.node(), | |
|
1675 | old.node())) | |
|
1676 | message = commitforceeditor(repo, cctx, []) | |
|
1671 | if not message: | |
|
1672 | message = old.description() | |
|
1677 | 1673 | |
|
1678 | 1674 | new = context.memctx(repo, |
|
1679 | 1675 | parents=[base.node(), nullid], |
@@ -1683,6 +1679,7 b' def amend(ui, repo, commitfunc, old, ext' | |||
|
1683 | 1679 | user=user, |
|
1684 | 1680 | date=date, |
|
1685 | 1681 | extra=extra) |
|
1682 | new._text = commitforceeditor(repo, new, []) | |
|
1686 | 1683 | ph = repo.ui.config('phases', 'new-commit', phases.draft) |
|
1687 | 1684 | try: |
|
1688 | 1685 | repo.ui.setconfig('phases', 'new-commit', old.phase()) |
@@ -167,6 +167,8 b' Same, but with changes in working dir (d' | |||
|
167 | 167 | $ echo a >> a |
|
168 | 168 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v |
|
169 | 169 | amending changeset ffb49186f961 |
|
170 | a | |
|
171 | copying changeset a4f8a65b7c6a to ad120869acf0 | |
|
170 | 172 | another precious commit message |
|
171 | 173 | |
|
172 | 174 | |
@@ -177,9 +179,7 b' Same, but with changes in working dir (d' | |||
|
177 | 179 | HG: branch 'default' |
|
178 | 180 | HG: changed a |
|
179 | 181 | a |
|
180 | copying changeset 27f3aacd3011 to ad120869acf0 | |
|
181 | a | |
|
182 | stripping intermediate changeset 27f3aacd3011 | |
|
182 | stripping intermediate changeset a4f8a65b7c6a | |
|
183 | 183 | stripping amended changeset ffb49186f961 |
|
184 | 184 | 2 changesets found |
|
185 | 185 | saved backup bundle to $TESTTMP/.hg/strip-backup/ffb49186f961-amend-backup.hg (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now