hgext/color.py
changeset 9311 e37e9904bf10
parent 9255 acfbb88c6ced
child 9374 ad73f6986ef5
--- a/hgext/color.py	Wed Aug 05 14:44:36 2009 +0200
+++ b/hgext/color.py	Wed Aug 05 15:00:44 2009 +0200
@@ -59,6 +59,7 @@
 '''
 
 import os, sys
+import itertools
 
 from mercurial import cmdutil, commands, extensions, error
 from mercurial.i18n import _
@@ -142,14 +143,10 @@
     '''run the qseries command with colored output'''
     ui.pushbuffer()
     retval = orig(ui, repo, **opts)
-    patches = ui.popbuffer().splitlines()
-    for patch in patches:
-        patchname = patch
-        if opts['summary']:
-            patchname = patchname.split(': ', 1)[0]
-        if ui.verbose:
-            patchname = patchname.lstrip().split(' ', 2)[-1]
+    patchlines = ui.popbuffer().splitlines()
+    patchnames = repo.mq.series
 
+    for patch, patchname in itertools.izip(patchlines, patchnames):
         if opts['missing']:
             effects = _patch_effects['missing']
         # Determine if patch is applied.