# HG changeset patch # User Brian Hulette # Date 1730342336 25200 # Node ID fad30cb9857984e4cf3bacb1dc91a89b050d75cc # Parent 51a350a22d0c8f8c85801d1782fd08f953676e1a histedit-continue: wire up `hg continue` and `histedit` diff -r 51a350a22d0c -r fad30cb98579 hgext/histedit.py --- a/hgext/histedit.py Wed Nov 20 15:53:19 2024 +0100 +++ b/hgext/histedit.py Wed Oct 30 19:38:56 2024 -0700 @@ -2348,6 +2348,21 @@ return state +def hgcontinuehistedit(ui, repo): + fm = ui.formatter(b'continue', {}) + fm.startitem() + + state = histeditstate(repo) + with repo.wlock() as wlock, repo.lock() as lock: + state.wlock = wlock + state.lock = lock + state.read() + state = bootstrapcontinue(ui, state, None) + _continuehistedit(ui, repo, state) + _finishhistedit(ui, repo, state, fm) + fm.end() + + def between(repo, old, new, keep): """select and validate the set of revision to edit @@ -2683,4 +2698,5 @@ allowcommit=True, continueflag=True, abortfunc=hgaborthistedit, + continuefunc=hgcontinuehistedit, ) diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-arguments.t Wed Oct 30 19:38:56 2024 -0700 @@ -163,7 +163,7 @@ $ echo alpha >> alpha $ mv .hg/histedit-state.back .hg/histedit-state - $ hg histedit --continue + $ hg continue saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: @ 4 f5ed five diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-base.t --- a/tests/test-histedit-base.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-base.t Wed Oct 30 19:38:56 2024 -0700 @@ -183,7 +183,7 @@ $ hg resolve --mark B (no more unresolved files) continue: hg histedit --continue - $ hg histedit --continue | fixbundle + $ hg continue | fixbundle $ hg tglog @ 6:03772da75548bb42a8f1eacd8c91d0717a147fcd:draft 'X' | diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-edit.t Wed Oct 30 19:38:56 2024 -0700 @@ -264,7 +264,7 @@ (test also that editor is invoked if histedit is continued for "edit" action) - $ HGEDITOR='cat' hg histedit --continue + $ HGEDITOR='cat' hg continue f @@ -441,7 +441,7 @@ Editing (cb9a9f314b8b), commit as needed now to split the change (to edit cb9a9f314b8b, `hg histedit --continue` after making changes) [240] - $ HGEDITOR=true hg histedit --continue + $ HGEDITOR=true hg continue saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-histedit.hg $ hg log -G diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-fold-non-commute.t --- a/tests/test-histedit-fold-non-commute.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-fold-non-commute.t Wed Oct 30 19:38:56 2024 -0700 @@ -130,7 +130,7 @@ (no more unresolved files) continue: hg histedit --continue $ hg diff - $ hg histedit --continue 2>&1 | fixbundle + $ hg continue 2>&1 | fixbundle 7f3755409b00: skipping changeset (no changes) log after edit @@ -269,7 +269,7 @@ $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue - $ hg histedit --continue 2>&1 | fixbundle + $ hg continue 2>&1 | fixbundle 7f3755409b00: skipping changeset (no changes) log after edit diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-fold.t Wed Oct 30 19:38:56 2024 -0700 @@ -378,7 +378,7 @@ $ hg commit -m '+5.2' created new head $ echo 6 >> file - $ HGEDITOR=cat hg histedit --continue + $ HGEDITOR=cat hg continue +4 *** +5.2 diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-non-commute.t --- a/tests/test-histedit-non-commute.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-non-commute.t Wed Oct 30 19:38:56 2024 -0700 @@ -161,7 +161,7 @@ (hg histedit --continue to resume) We forcibly enable curses here so we can verify that continuing works with curses enabled. - $ hg histedit --continue --config ui.interactive=true \ + $ hg continue --config ui.interactive=true \ > --config ui.interface=curses 2>&1 | fixbundle abort: unresolved merge conflicts (see 'hg help resolve') @@ -176,7 +176,7 @@ $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue - $ hg histedit --continue 2>&1 | fixbundle + $ hg continue 2>&1 | fixbundle 7b4e2f4b7bcd: skipping changeset (no changes) log after edit @@ -258,7 +258,7 @@ $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue - $ hg histedit --continue 2>&1 | fixbundle + $ hg continue 2>&1 | fixbundle 7b4e2f4b7bcd: skipping changeset (no changes) post message fix diff -r 51a350a22d0c -r fad30cb98579 tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t Wed Nov 20 15:53:19 2024 +0100 +++ b/tests/test-histedit-obsolete.t Wed Oct 30 19:38:56 2024 -0700 @@ -80,7 +80,7 @@ $ hg commit --amend -X . -m XXXXXX $ hg commit --amend -X . -m b2 $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup - $ hg histedit --continue + $ hg continue $ hg log -G @ 8:273c1f3b8626 c | @@ -363,7 +363,7 @@ (to edit b449568bf7fc, `hg histedit --continue` after making changes) [240] $ echo f >> f - $ hg histedit --continue + $ hg continue $ hg log -G @ 24:12e89af74238 (secret) k | @@ -569,7 +569,7 @@ Editing (ee118ab9fa44), commit as needed now to split the change (to edit ee118ab9fa44, `hg histedit --continue` after making changes) [240] - $ hg histedit --continue --config experimental.evolution.track-operation=1 + $ hg continue --config experimental.evolution.track-operation=1 $ hg log -G @ 23:175d6b286a22 (secret) k |