Mercurial > hg
changeset 17771:dcfa526b180b
histedit: create obsolescence markers in deterministic order
I arbitrary use the revnum of the precursor because it sound a right order.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 16 Oct 2012 16:56:14 +0200 |
parents | 6c81b8ebf66e |
children | 823a7d79ef82 |
files | hgext/histedit.py tests/test-histedit-obsolete.t |
diffstat | 2 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Mon Oct 15 23:54:54 2012 -0400 +++ b/hgext/histedit.py Tue Oct 16 16:56:14 2012 +0200 @@ -514,7 +514,9 @@ # TODO update mq state if obsolete._enabled: markers = [] - for prec, succs in mapping.iteritems(): + # sort by revision number because it sound "right" + for prec in sorted(mapping, key=repo.changelog.rev): + succs = mapping[prec] markers.append((repo[prec], tuple(repo[s] for s in succs))) if markers:
--- a/tests/test-histedit-obsolete.t Mon Oct 15 23:54:54 2012 -0400 +++ b/tests/test-histedit-obsolete.t Tue Oct 16 16:56:14 2012 +0200 @@ -87,11 +87,12 @@ o 0:cb9a9f314b8b a $ hg debugobsolete - e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*', 'user': 'test'} (glob) - 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '*': 'test'} (glob) - d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '*', 'user': 'test'} (glob) - 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '*': 'test'} (glob) - 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '*', 'user': 'test'} (glob) + d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob) + 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '* *', 'user': 'test'} (glob) + 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob) + e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob) + 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '* *', 'user': 'test'} (glob) + Ensure hidden revision does not prevent histedit -------------------------------------------------