Show More
@@ -1969,7 +1969,11 b' def amend(ui, repo, commitfunc, old, ext' | |||
|
1969 | 1969 | |
|
1970 | 1970 | ph = repo.ui.config('phases', 'new-commit', phases.draft) |
|
1971 | 1971 | try: |
|
1972 | repo.ui.setconfig('phases', 'new-commit', old.phase()) | |
|
1972 | if opts.get('secret'): | |
|
1973 | commitphase = 'secret' | |
|
1974 | else: | |
|
1975 | commitphase = old.phase() | |
|
1976 | repo.ui.setconfig('phases', 'new-commit', commitphase) | |
|
1973 | 1977 | newid = repo.commitctx(new) |
|
1974 | 1978 | finally: |
|
1975 | 1979 | repo.ui.setconfig('phases', 'new-commit', ph) |
@@ -1397,6 +1397,7 b' def commit(ui, repo, *pats, **opts):' | |||
|
1397 | 1397 | if opts.get('force_editor'): |
|
1398 | 1398 | e = cmdutil.commitforceeditor |
|
1399 | 1399 | |
|
1400 | # commitfunc is used only for temporary amend commit by cmdutil.amend | |
|
1400 | 1401 | def commitfunc(ui, repo, message, match, opts): |
|
1401 | 1402 | editor = e |
|
1402 | 1403 | # message contains text from -m or -l, if it's empty, |
@@ -1404,18 +1405,12 b' def commit(ui, repo, *pats, **opts):' | |||
|
1404 | 1405 | if not message: |
|
1405 | 1406 | message = old.description() |
|
1406 | 1407 | editor = cmdutil.commitforceeditor |
|
1407 | try: | |
|
1408 |
|
|
|
1409 | ui.setconfig('phases', 'new-commit', 'secret') | |
|
1410 | ||
|
1411 | return repo.commit(message, | |
|
1412 |
|
|
|
1413 | opts.get('date') or old.date(), | |
|
1414 | match, | |
|
1415 | editor=editor, | |
|
1416 | extra=extra) | |
|
1417 | finally: | |
|
1418 | ui.setconfig('phases', 'new-commit', oldcommitphase) | |
|
1408 | return repo.commit(message, | |
|
1409 | opts.get('user') or old.user(), | |
|
1410 | opts.get('date') or old.date(), | |
|
1411 | match, | |
|
1412 | editor=editor, | |
|
1413 | extra=extra) | |
|
1419 | 1414 | |
|
1420 | 1415 | current = repo._bookmarkcurrent |
|
1421 | 1416 | marks = old.bookmarks() |
@@ -506,7 +506,7 b' def revrange(repo, revs):' | |||
|
506 | 506 | start, end = spec.split(_revrangesep, 1) |
|
507 | 507 | start = revfix(repo, start, 0) |
|
508 | 508 | end = revfix(repo, end, len(repo) - 1) |
|
509 |
if end == nullrev and start < |
|
|
509 | if end == nullrev and start < 0: | |
|
510 | 510 | start = nullrev |
|
511 | 511 | rangeiter = repo.changelog.revs(start, end) |
|
512 | 512 | if not seen and not l: |
@@ -765,3 +765,14 b' This silliness fails:' | |||
|
765 | 765 | $ hg ci --close-branch -m'open and close' |
|
766 | 766 | abort: can only close branch heads |
|
767 | 767 | [255] |
|
768 | ||
|
769 | Test that amend with --secret creates new secret changeset forcibly | |
|
770 | --------------------------------------------------------------------- | |
|
771 | ||
|
772 | $ hg phase '.^::.' | |
|
773 | 35: draft | |
|
774 | 36: draft | |
|
775 | $ hg commit --amend --secret -m 'amend as secret' -q | |
|
776 | $ hg phase '.^::.' | |
|
777 | 35: draft | |
|
778 | 38: secret |
@@ -2111,6 +2111,11 b' The almost-empty template should do some' | |||
|
2111 | 2111 | issue3772 |
|
2112 | 2112 | |
|
2113 | 2113 | $ hg log -G -r :null |
|
2114 | o changeset: 0:f8035bb17114 | |
|
2115 | | user: test | |
|
2116 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
2117 | | summary: add a | |
|
2118 | | | |
|
2114 | 2119 | o changeset: -1:000000000000 |
|
2115 | 2120 | user: |
|
2116 | 2121 | date: Thu Jan 01 00:00:00 1970 +0000 |
@@ -1356,6 +1356,12 b' test hg log on non-existent files and on' | |||
|
1356 | 1356 | issue3772: hg log -r :null showing revision 0 as well |
|
1357 | 1357 | |
|
1358 | 1358 | $ hg log -r :null |
|
1359 | changeset: 0:65624cd9070a | |
|
1360 | tag: tip | |
|
1361 | user: test | |
|
1362 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
1363 | summary: a bunch of weird directories | |
|
1364 | ||
|
1359 | 1365 | changeset: -1:000000000000 |
|
1360 | 1366 | user: |
|
1361 | 1367 | date: Thu Jan 01 00:00:00 1970 +0000 |
General Comments 0
You need to be logged in to leave comments.
Login now