# HG changeset patch # User Anton Shestakov # Date 1598052286 -28800 # Node ID 77c0ddd6f172e2936792b5ecc6e60cfea0cf8a66 # Parent 1896d6bc574bdeca418955a603fc96bdd128ae51 split: use the last created commit as target for discard action diff -r 1896d6bc574b -r 77c0ddd6f172 CHANGELOG --- a/CHANGELOG Sat Aug 22 07:18:55 2020 +0800 +++ b/CHANGELOG Sat Aug 22 07:24:46 2020 +0800 @@ -7,6 +7,9 @@ * py3: use '%d' for formatting revision numbers in stable range cache warning (issue6390) + * split: correctly handle discard action after previously splitting changes + into more than one commit + 10.0.1 -- 2020-07-31 -------------------- diff -r 1896d6bc574b -r 77c0ddd6f172 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Sat Aug 22 07:18:55 2020 +0800 +++ b/hgext3rd/evolve/cmdrewrite.py Sat Aug 22 07:24:46 2020 +0800 @@ -1307,7 +1307,7 @@ # diff action or by showing the remaining and # prompting for confirmation ui.status(_(b'discarding remaining changes\n')) - target = newcommits[0] + target = newcommits[-1] args = [] kwargs = {} code = cmdutil.revert.__code__ diff -r 1896d6bc574b -r 77c0ddd6f172 tests/test-split.t --- a/tests/test-split.t Sat Aug 22 07:18:55 2020 +0800 +++ b/tests/test-split.t Sat Aug 22 07:24:46 2020 +0800 @@ -1316,8 +1316,6 @@ > f > d > d - > s - > c > EOF 0 files updated, 0 files merged, 3 files removed, 0 files unresolved adding a @@ -1349,25 +1347,9 @@ continue splitting? [Ycdq?] d discarding remaining changes forgetting c - removing b - diff --git a/b b/b - deleted file mode 100644 - examine changes to 'b'? - (enter ? for help) [Ynesfdaq?] s - - no changes to record - continue splitting? [Ycdq?] c $ hg glog -p - @ 3:bdee57117c76 split3 (draft) - | diff --git a/b b/b - | deleted file mode 100644 - | --- a/b - | +++ /dev/null - | @@ -1,1 +0,0 @@ - | -b - | - o 2:c2c6f4d8c766 split2 (draft) + @ 2:c2c6f4d8c766 split2 (draft) | diff --git a/b b/b | new file mode 100644 | --- /dev/null