equal
deleted
inserted
replaced
603 for f, bids in sorted(fbids.items()): |
603 for f, bids in sorted(fbids.items()): |
604 # bids is a mapping from action method to list af actions |
604 # bids is a mapping from action method to list af actions |
605 # Consensus? |
605 # Consensus? |
606 if len(bids) == 1: # all bids are the same kind of method |
606 if len(bids) == 1: # all bids are the same kind of method |
607 m, l = bids.items()[0] |
607 m, l = bids.items()[0] |
608 if util.all(a == l[0] for a in l[1:]): # len(bids) is > 1 |
608 if all(a == l[0] for a in l[1:]): # len(bids) is > 1 |
609 repo.ui.note(" %s: consensus for %s\n" % (f, m)) |
609 repo.ui.note(" %s: consensus for %s\n" % (f, m)) |
610 actions[f] = l[0] |
610 actions[f] = l[0] |
611 continue |
611 continue |
612 # If keep is an option, just do it. |
612 # If keep is an option, just do it. |
613 if 'k' in bids: |
613 if 'k' in bids: |
615 actions[f] = bids['k'][0] |
615 actions[f] = bids['k'][0] |
616 continue |
616 continue |
617 # If there are gets and they all agree [how could they not?], do it. |
617 # If there are gets and they all agree [how could they not?], do it. |
618 if 'g' in bids: |
618 if 'g' in bids: |
619 ga0 = bids['g'][0] |
619 ga0 = bids['g'][0] |
620 if util.all(a == ga0 for a in bids['g'][1:]): |
620 if all(a == ga0 for a in bids['g'][1:]): |
621 repo.ui.note(" %s: picking 'get' action\n" % f) |
621 repo.ui.note(" %s: picking 'get' action\n" % f) |
622 actions[f] = ga0 |
622 actions[f] = ga0 |
623 continue |
623 continue |
624 # TODO: Consider other simple actions such as mode changes |
624 # TODO: Consider other simple actions such as mode changes |
625 # Handle inefficient democrazy. |
625 # Handle inefficient democrazy. |