mq: account for readheaders munging in qrefresh
authorBrendan Cully <brendan@kublai.com>
Tue, 01 May 2007 13:23:32 -0700
changeset 4403 15289406f89c
parent 4395 47ef2d228375
child 4404 47371e1c1db4
mq: account for readheaders munging in qrefresh
hgext/mq.py
--- a/hgext/mq.py	Tue May 01 14:42:54 2007 -0500
+++ b/hgext/mq.py	Tue May 01 13:23:32 2007 -0700
@@ -985,8 +985,11 @@
             if comments:
                 # Remove existing message.
                 ci = 0
+                subj = None
                 for mi in xrange(len(message)):
-                    while message[mi] != comments[ci]:
+                    if comments[ci].lower().startswith('subject: '):
+                        subj = comments[ci][9:]
+                    while message[mi] != comments[ci] and message[mi] != subj:
                         ci += 1
                     del comments[ci]
             comments.append(msg)