##// 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 10 import os, sys, errno, re, tempfile
11 11 import util, scmutil, templater, patch, error, templatekw, revlog, copies
12 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 15 def parsealiases(cmd):
16 16 return cmd.lstrip("^").split("|")
@@ -1668,7 +1668,12 b' def amend(ui, repo, commitfunc, old, ext'
1668 1668 user=user,
1669 1669 date=date,
1670 1670 extra=extra)
1671 ph = repo.ui.config('phases', 'new-commit', phases.draft)
1672 try:
1673 repo.ui.setconfig('phases', 'new-commit', old.phase())
1671 1674 newid = repo.commitctx(new)
1675 finally:
1676 repo.ui.setconfig('phases', 'new-commit', ph)
1672 1677 if newid != old.node():
1673 1678 # Reroute the working copy parent to the new changeset
1674 1679 repo.setparents(newid, nullid)
@@ -355,3 +355,18 b" first graft something so there's an addi"
355 355 $ hg log -r . --debug | grep extra
356 356 extra: branch=a
357 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