Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 34348:1a5abc45e2fa
py3: explicitly convert dict.keys() and dict.items() into a list
Differential Revision: https://phab.mercurial-scm.org/D853
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 30 Sep 2017 15:45:15 +0530 |
parents | 440ece43024c |
children | 6f49ea88d984 |
comparison
equal
deleted
inserted
replaced
34347:87a6be5b29f4 | 34348:1a5abc45e2fa |
---|---|
1027 dms = [] # filenames that have dm actions | 1027 dms = [] # filenames that have dm actions |
1028 for f, bids in sorted(fbids.items()): | 1028 for f, bids in sorted(fbids.items()): |
1029 # bids is a mapping from action method to list af actions | 1029 # bids is a mapping from action method to list af actions |
1030 # Consensus? | 1030 # Consensus? |
1031 if len(bids) == 1: # all bids are the same kind of method | 1031 if len(bids) == 1: # all bids are the same kind of method |
1032 m, l = bids.items()[0] | 1032 m, l = list(bids.items())[0] |
1033 if all(a == l[0] for a in l[1:]): # len(bids) is > 1 | 1033 if all(a == l[0] for a in l[1:]): # len(bids) is > 1 |
1034 repo.ui.note(_(" %s: consensus for %s\n") % (f, m)) | 1034 repo.ui.note(_(" %s: consensus for %s\n") % (f, m)) |
1035 actions[f] = l[0] | 1035 actions[f] = l[0] |
1036 if m == 'dm': | 1036 if m == 'dm': |
1037 dms.append(f) | 1037 dms.append(f) |
1053 repo.ui.note(_(' %s: multiple bids for merge action:\n') % f) | 1053 repo.ui.note(_(' %s: multiple bids for merge action:\n') % f) |
1054 for m, l in sorted(bids.items()): | 1054 for m, l in sorted(bids.items()): |
1055 for _f, args, msg in l: | 1055 for _f, args, msg in l: |
1056 repo.ui.note(' %s -> %s\n' % (msg, m)) | 1056 repo.ui.note(' %s -> %s\n' % (msg, m)) |
1057 # Pick random action. TODO: Instead, prompt user when resolving | 1057 # Pick random action. TODO: Instead, prompt user when resolving |
1058 m, l = bids.items()[0] | 1058 m, l = list(bids.items())[0] |
1059 repo.ui.warn(_(' %s: ambiguous merge - picked %s action\n') % | 1059 repo.ui.warn(_(' %s: ambiguous merge - picked %s action\n') % |
1060 (f, m)) | 1060 (f, m)) |
1061 actions[f] = l[0] | 1061 actions[f] = l[0] |
1062 if m == 'dm': | 1062 if m == 'dm': |
1063 dms.append(f) | 1063 dms.append(f) |