##// END OF EJS Templates
amend: preserve phase of amended revision (issue3602)...
Pierre-Yves David -
r17461:bacde764 stable
parent child Browse files
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("|")
@@ -1668,7 +1668,12 b' def amend(ui, repo, commitfunc, old, ext'
1668 user=user,
1668 user=user,
1669 date=date,
1669 date=date,
1670 extra=extra)
1670 extra=extra)
1671 newid = repo.commitctx(new)
1671 ph = repo.ui.config('phases', 'new-commit', phases.draft)
1672 try:
1673 repo.ui.setconfig('phases', 'new-commit', old.phase())
1674 newid = repo.commitctx(new)
1675 finally:
1676 repo.ui.setconfig('phases', 'new-commit', ph)
1672 if newid != old.node():
1677 if newid != old.node():
1673 # Reroute the working copy parent to the new changeset
1678 # Reroute the working copy parent to the new changeset
1674 repo.setparents(newid, nullid)
1679 repo.setparents(newid, nullid)
@@ -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
General Comments 0
You need to be logged in to leave comments. Login now