hgext/mq.py
changeset 7568 12df451ce205
parent 7566 5f7e3f17aece
child 7607 3cf85220a9f9
child 7614 f9fcb189c8e2
--- a/hgext/mq.py	Mon Jan 05 14:34:20 2009 +0100
+++ b/hgext/mq.py	Tue Jan 06 10:30:22 2009 +0100
@@ -838,14 +838,11 @@
                 if s == 'qbase':
                     return self.series[0]
             return None
+
         if patch == None:
             return None
-
-        # we don't want to return a partial match until we make
-        # sure the file name passed in does not exist (checked below)
-        res = partial_name(patch)
-        if res and res == patch:
-            return res
+        if patch in self.series:
+            return patch
 
         if not os.path.isfile(self.join(patch)):
             try:
@@ -853,10 +850,11 @@
             except(ValueError, OverflowError):
                 pass
             else:
-                if sno < len(self.series):
+                if -len(self.series) <= sno < len(self.series):
                     return self.series[sno]
+
             if not strict:
-                # return any partial match made above
+                res = partial_name(patch)
                 if res:
                     return res
                 minus = patch.rfind('-')