Show More
@@ -1969,7 +1969,11 b' def amend(ui, repo, commitfunc, old, ext' | |||||
1969 |
|
1969 | |||
1970 | ph = repo.ui.config('phases', 'new-commit', phases.draft) |
|
1970 | ph = repo.ui.config('phases', 'new-commit', phases.draft) | |
1971 | try: |
|
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 | newid = repo.commitctx(new) |
|
1977 | newid = repo.commitctx(new) | |
1974 | finally: |
|
1978 | finally: | |
1975 | repo.ui.setconfig('phases', 'new-commit', ph) |
|
1979 | repo.ui.setconfig('phases', 'new-commit', ph) |
@@ -1397,6 +1397,7 b' def commit(ui, repo, *pats, **opts):' | |||||
1397 | if opts.get('force_editor'): |
|
1397 | if opts.get('force_editor'): | |
1398 | e = cmdutil.commitforceeditor |
|
1398 | e = cmdutil.commitforceeditor | |
1399 |
|
1399 | |||
|
1400 | # commitfunc is used only for temporary amend commit by cmdutil.amend | |||
1400 | def commitfunc(ui, repo, message, match, opts): |
|
1401 | def commitfunc(ui, repo, message, match, opts): | |
1401 | editor = e |
|
1402 | editor = e | |
1402 | # message contains text from -m or -l, if it's empty, |
|
1403 | # message contains text from -m or -l, if it's empty, | |
@@ -1404,18 +1405,12 b' def commit(ui, repo, *pats, **opts):' | |||||
1404 | if not message: |
|
1405 | if not message: | |
1405 | message = old.description() |
|
1406 | message = old.description() | |
1406 | editor = cmdutil.commitforceeditor |
|
1407 | editor = cmdutil.commitforceeditor | |
1407 | try: |
|
1408 | return repo.commit(message, | |
1408 |
|
|
1409 | opts.get('user') or old.user(), | |
1409 | ui.setconfig('phases', 'new-commit', 'secret') |
|
1410 | opts.get('date') or old.date(), | |
1410 |
|
1411 | match, | ||
1411 | return repo.commit(message, |
|
1412 | editor=editor, | |
1412 |
|
|
1413 | extra=extra) | |
1413 | opts.get('date') or old.date(), |
|
|||
1414 | match, |
|
|||
1415 | editor=editor, |
|
|||
1416 | extra=extra) |
|
|||
1417 | finally: |
|
|||
1418 | ui.setconfig('phases', 'new-commit', oldcommitphase) |
|
|||
1419 |
|
1414 | |||
1420 | current = repo._bookmarkcurrent |
|
1415 | current = repo._bookmarkcurrent | |
1421 | marks = old.bookmarks() |
|
1416 | marks = old.bookmarks() |
@@ -506,7 +506,7 b' def revrange(repo, revs):' | |||||
506 | start, end = spec.split(_revrangesep, 1) |
|
506 | start, end = spec.split(_revrangesep, 1) | |
507 | start = revfix(repo, start, 0) |
|
507 | start = revfix(repo, start, 0) | |
508 | end = revfix(repo, end, len(repo) - 1) |
|
508 | end = revfix(repo, end, len(repo) - 1) | |
509 |
if end == nullrev and start < |
|
509 | if end == nullrev and start < 0: | |
510 | start = nullrev |
|
510 | start = nullrev | |
511 | rangeiter = repo.changelog.revs(start, end) |
|
511 | rangeiter = repo.changelog.revs(start, end) | |
512 | if not seen and not l: |
|
512 | if not seen and not l: |
@@ -765,3 +765,14 b' This silliness fails:' | |||||
765 | $ hg ci --close-branch -m'open and close' |
|
765 | $ hg ci --close-branch -m'open and close' | |
766 | abort: can only close branch heads |
|
766 | abort: can only close branch heads | |
767 | [255] |
|
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 | issue3772 |
|
2111 | issue3772 | |
2112 |
|
2112 | |||
2113 | $ hg log -G -r :null |
|
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 | o changeset: -1:000000000000 |
|
2119 | o changeset: -1:000000000000 | |
2115 | user: |
|
2120 | user: | |
2116 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
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 | issue3772: hg log -r :null showing revision 0 as well |
|
1356 | issue3772: hg log -r :null showing revision 0 as well | |
1357 |
|
1357 | |||
1358 | $ hg log -r :null |
|
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 | changeset: -1:000000000000 |
|
1365 | changeset: -1:000000000000 | |
1360 | user: |
|
1366 | user: | |
1361 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1367 | date: Thu Jan 01 00:00:00 1970 +0000 |
General Comments 0
You need to be logged in to leave comments.
Login now