Read about our upcoming Code of Conduct on this issue

Commit d21c78fa authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

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.
parent 2c3fd1bb2752
......@@ -1622,10 +1622,12 @@ def evolve(ui, repo, **opts):
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']:
listtroubles(ui, repo, specifiedcategories, **opts)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment