# HG changeset patch # User Martin von Zweigbergk # Date 1563392857 25200 # Node ID 75bc0a51809a7ebcf5fed747b905c516c287e630 # Parent 2c3fd1bb2752b3af0f130c147b7860b5d7a20abc 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. diff -r 2c3fd1bb2752 -r 75bc0a51809a hgext3rd/evolve/evolvecmd.py --- 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)