py3: redefine "troublecategories" in evolve as a dict
We'll want to the keys to be bytes and the values to be unicode on
py3. Having it defined as a dict makes that easier (instead of
converting between the types with e.g. pycompat.sysbytes()). It was
kind of ugly to convert between the forms by stripping '_' from the
string anyway.
--- a/hgext3rd/evolve/evolvecmd.py Fri Jul 12 08:11:39 2019 -0700
+++ b/hgext3rd/evolve/evolvecmd.py Wed Jul 17 12:47:37 2019 -0700
@@ -1622,10 +1622,12 @@
abortopt = opts['abort']
shouldupdate = opts['update']
- troublecategories = ['phase_divergent', 'content_divergent', 'orphan']
- specifiedcategories = [t.replace('_', '')
- for t in troublecategories
- if opts[t]]
+ troublecategories = {
+ 'phasedivergent': 'phase_divergent',
+ 'contentdivergent': 'content_divergent',
+ 'orphan': 'orphan',
+ }
+ specifiedcategories = [k for k, v in troublecategories.items() if opts[v]]
if opts['list']:
ui.pager('evolve')
listtroubles(ui, repo, specifiedcategories, **opts)