comparison mercurial/obsutil.py @ 35010:b81ad5b78a81

obsfate: makes successorsetverb takes the markers as argument Right now, successorsetverb only needs successors to compute the verb. But we will want use additional information (effect-flags and operation) in the near future to compute a better verb. Add the markers parameter now so extensions (like Evolve) could wrap the function and start experimenting around better obsfate verbs. As successorsetverb now takes both successorset and markers parameters, rename it to obsfateverb, successorsetandmarkersverb was too long. Differential Revision: https://phab.mercurial-scm.org/D1191
author Boris Feld <boris.feld@octobus.net>
date Thu, 19 Oct 2017 12:35:47 +0200
parents aa849cf5d089
children 137a08d82232
comparison
equal deleted inserted replaced
35007:407ec7f3ff02 35010:b81ad5b78a81
749 for sset in fullsuccessorsets: 749 for sset in fullsuccessorsets:
750 values.append({'successors': sset, 'markers': sset.markers}) 750 values.append({'successors': sset, 'markers': sset.markers})
751 751
752 return values 752 return values
753 753
754 def successorsetverb(successorset): 754 def obsfateverb(successorset, markers):
755 """ Return the verb summarizing the successorset 755 """ Return the verb summarizing the successorset and potentially using
756 information from the markers
756 """ 757 """
757 if not successorset: 758 if not successorset:
758 verb = 'pruned' 759 verb = 'pruned'
759 elif len(successorset) == 1: 760 elif len(successorset) == 1:
760 verb = 'rewritten' 761 verb = 'rewritten'
793 normal = not verbose and not quiet 794 normal = not verbose and not quiet
794 795
795 line = [] 796 line = []
796 797
797 # Verb 798 # Verb
798 line.append(successorsetverb(successors)) 799 line.append(obsfateverb(successors, markers))
799 800
800 # Operations 801 # Operations
801 operations = markersoperations(markers) 802 operations = markersoperations(markers)
802 if operations: 803 if operations:
803 line.append(" using %s" % ", ".join(operations)) 804 line.append(" using %s" % ", ".join(operations))