# HG changeset patch # User Martin von Zweigbergk # Date 1547227601 28800 # Node ID 5300be965515eab0a9473a81e7256972a0ebab06 # Parent 0f015fe4f71f1f4fe36e9af600291ced8f8104e3 fold: sort concatenated commit messages in topological order It seems better to have the proposed commit message look the same whether the user ran `hg fold --exact -r . -r .^` or `hg fold --exact -r .^ -r .`. diff -r 0f015fe4f71f -r 5300be965515 CHANGELOG --- a/CHANGELOG Wed Dec 26 14:52:07 2018 +0800 +++ b/CHANGELOG Fri Jan 11 09:26:41 2019 -0800 @@ -9,6 +9,7 @@ * split: no longer accept revision with --rev (BC) * split: accept file patterns * split: support for non interactive splits + * fold: concatenate commit message in revision order * push: have `--publish` overrule the `auto-publish` config * next: evolve aspiring children by default (use --no-evolve to skip) * next: pick lower part of a split as destination diff -r 0f015fe4f71f -r 5300be965515 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Wed Dec 26 14:52:07 2018 +0800 +++ b/hgext3rd/evolve/cmdrewrite.py Fri Jan 11 09:26:41 2019 -0800 @@ -740,6 +740,10 @@ ui.write_err(_('single revision specified, nothing to fold\n')) return 1 + # Sort so combined commit message of `hg fold --exact -r . -r .^` is + # in topological order. + revs.sort() + wlock = lock = None try: wlock = repo.wlock() diff -r 0f015fe4f71f -r 5300be965515 tests/test-evolve-phase-divergence.t --- a/tests/test-evolve-phase-divergence.t Wed Dec 26 14:52:07 2018 +0800 +++ b/tests/test-evolve-phase-divergence.t Fri Jan 11 09:26:41 2019 -0800 @@ -893,7 +893,7 @@ 1 new phase-divergent changesets $ hg glog -r f3794e5a91dc:: - @ 24:e450d05b7d27 added g + @ 24:390acb97e50a added f | () draft | o 23:428f7900a969 added g | | () public @@ -906,14 +906,14 @@ ~ $ hg evolve --list - e450d05b7d27: added g + 390acb97e50a: added f phase-divergent: 21ae52e414e6 (immutable precursor) phase-divergent: 428f7900a969 (immutable precursor) Resolving phase divergence using `hg evolve` $ hg evolve --phase-divergent --all - recreate:[24] added g + recreate:[24] added f atop:[23] added g rebasing to destination parent: 21ae52e414e6 computing new diff diff -r 0f015fe4f71f -r 5300be965515 tests/test-fold.t --- a/tests/test-fold.t Wed Dec 26 14:52:07 2018 +0800 +++ b/tests/test-fold.t Fri Jan 11 09:26:41 2019 -0800 @@ -244,5 +244,29 @@ | o 0 - 1ea73414a91b r0 [debugbuilddag] (public) +Test order of proposed commit message + + $ hg fold --exact --hidden -r 4 -r 5 -r 6 + 2 new content-divergent changesets + 3 changesets folded + $ hg log -r tip -T '{desc}' + r4 + + + r5 + + + r6 (no-eol) + $ hg fold --exact --hidden -r 6 -r 4 -r 5 + 3 changesets folded + $ hg log -r tip -T '{desc}' + r4 + + + r5 + + + r6 (no-eol) + $ cd ..