obshistory: omit duplicate notes of obsolescence operations
authorAnton Shestakov <av6@dwimlabs.net>
Tue, 05 May 2020 15:43:43 +0800
changeset 5336 b55c0cea3fa2
parent 5335 3847dedd12d7
child 5337 9eba849b4c3d
obshistory: omit duplicate notes of obsolescence operations When folding changesets, it's possible to provide a --note flag to e.g. fold or prune, which will store a note for that operation. But since there would be more than one marker for the fold operation and the provided note would be stored in all of them, _markersnotes() previously would return the same text message many times. We don't really want to see the same thing over and over, so let's make notes a set(). This will also make unrelated operations with the same note show the message only once, which is probably an improvement too.
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Tue May 05 20:25:33 2020 +0200
+++ b/hgext3rd/evolve/obshistory.py	Tue May 05 15:43:43 2020 +0800
@@ -711,7 +711,7 @@
 
 def _markersnotes(markers):
     markersmeta = [dict(m[3]) for m in markers]
-    notes = [meta.get(b'note') for meta in markersmeta]
+    notes = {meta.get(b'note') for meta in markersmeta}
     return sorted(note for note in notes if note)
 
 EFFECTMAPPING = util.sortdict([