Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 16453:d2a865d4b963
revset: make matching() work on python 2.4
tuple.index() was apparently added to python 2.6:
http://bugs.python.org/issue1696444
Also remove a trailing comma to make check-code.py happy.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Tue, 17 Apr 2012 10:33:47 +0200 |
parents | 8a72805034d5 |
children | 7f59900e3f8b |
comparison
equal
deleted
inserted
replaced
16452:8a72805034d5 | 16453:d2a865d4b963 |
---|---|
950 fields.discard('summary') | 950 fields.discard('summary') |
951 | 951 |
952 # We may want to match more than one field | 952 # We may want to match more than one field |
953 # Not all fields take the same amount of time to be matched | 953 # Not all fields take the same amount of time to be matched |
954 # Sort the selected fields in order of increasing matching cost | 954 # Sort the selected fields in order of increasing matching cost |
955 fieldorder = ('phase parents user date branch summary files description' | 955 fieldorder = ['phase', 'parents', 'user', 'date', 'branch', 'summary', |
956 ' substate').split() | 956 'files', 'description', 'substate'] |
957 def fieldkeyfunc(f): | 957 def fieldkeyfunc(f): |
958 try: | 958 try: |
959 return fieldorder.index(f) | 959 return fieldorder.index(f) |
960 except ValueError: | 960 except ValueError: |
961 # assume an unknown field is very costly | 961 # assume an unknown field is very costly |