Commits

Patrick Mézard  committed 73b616d

Handle subjects like "[PATCH 0 of 2] Re:[PATCH 0 of 3]..."

  • Participants
  • Parent commits 6b97968

Comments (0)

Files changed (3)

     return l.encode('utf-8')
 
 re_mailheaderlinebreak = re.compile('\r?\n[ \t]', re.M)
-re_patchsubject = re.compile(r'^.*\[PATCH(\s.+?)?\]\s*(.+)$')
+re_patchsubject = re.compile(r'^.*?\[PATCH(\s.+?)?\]\s*(.+)$')
 re_patchnum = re.compile(r'^\s+(\d+)\s+of\s+(\d+)')
 
 def parsesubject(s):

File test-mbox.out

 import this group? [Nydq?]  
 0 patches imported
 % test duplicates
-[PATCH 0 of 2] header
+[PATCH 0 of 2] Re:[PATCH 0 of 10] don't ask
     [PATCH 1 of 2] patch 1 of 2 replacement
     [PATCH 2 of 2] patch 2 of 2
 import this group? [Nydq?]  

File tests/testdupes.mbx

 Received: by 10.114.108.3 with SMTP id g3cs509927wac;
         Mon, 29 Dec 2008 17:13:30 -0800 (PST)
 MIME-Version: 1.0
-Subject: [PATCH 0 of 2] header
+Subject: [PATCH 0 of 2] Re:[PATCH 0 of 10] don't ask
 Message-Id: <0ab3c4562bd574dbd782.1230599538@localhost>
 Date: Tue, 16 Dec 2008 02:12:18 +0100
 From: Bar Baz <barbaz@gmail.com>