--- a/.issues/cf0d1e2ca226848d/new/1268012009.M102732P9773Q1.vlan-laptop Mon Nov 15 10:39:40 2010 -0800
+++ b/.issues/cf0d1e2ca226848d/new/1268012009.M102732P9773Q1.vlan-laptop Mon Nov 15 10:46:46 2010 -0800
@@ -1,8 +1,9 @@
From: Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>
Date: Mon, 08 Mar 2010 01:23:25 +0300
-State: new
+State: resolved
Subject: KeyError while accessing an empty Maildir
Message-Id: <cf0d1e2ca226848d-0-artemis@vlan-laptop>
+resolution: fixed
If a Maildir contains no message files, `hg ilist` raises the following
exception:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.issues/cf0d1e2ca226848d/new/1289846722.M853744P9554Q1.cole Mon Nov 15 10:46:46 2010 -0800
@@ -0,0 +1,8 @@
+From: Dmitriy Morozov <dmitriy@mrzv.org>
+Date: Mon, 15 Nov 2010 10:44:57 -0800
+Subject: ilist ignores empty Maildirs
+Message-Id: <cf0d1e2ca226848d-c95c687999e65b87-artemis@cole>
+References: <cf0d1e2ca226848d-0-artemis@vlan-laptop>
+In-Reply-To: <cf0d1e2ca226848d-0-artemis@vlan-laptop>
+
+If _find_root_key() returns None on a directory, ilist will ignore it.
--- a/artemis.py Mon Nov 15 10:39:40 2010 -0800
+++ b/artemis.py Mon Nov 15 10:46:46 2010 -0800
@@ -60,6 +60,7 @@
for issue in issues:
mbox = mailbox.Maildir(issue, factory=mailbox.MaildirMessage)
root = _find_root_key(mbox)
+ if not root: continue
property_match = True
for property,value in properties:
if value: