[PATCH] revset: make matching() work on python 2.4
Patrick Mezard
patrick at mezard.eu
Tue Apr 17 03:43:40 CDT 2012
# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1334651627 -7200
# Node ID 96360327f780653c59ba2cdba24a61f28e07561d
# Parent 9c431cfdca128ff0be522a4560032e4223cfd99b
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.
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -952,8 +952,8 @@
# We may want to match more than one field
# Not all fields take the same amount of time to be matched
# Sort the selected fields in order of increasing matching cost
- fieldorder = ('phase', 'parents', 'user', 'date', 'branch', 'summary',
- 'files', 'description', 'substate',)
+ fieldorder = ['phase', 'parents', 'user', 'date', 'branch', 'summary',
+ 'files', 'description', 'substate']
def fieldkeyfunc(f):
try:
return fieldorder.index(f)
More information about the Mercurial-devel
mailing list