diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2020-01-09 15:43:43 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-01-09 15:47:30 +0100 |
commit | 453fcb5a5f1323d1be1187ab0499dfd14dd9c6bb (patch) | |
tree | 0fbaaa2a19dcb6139a714d7fc3938ae9b5055ec6 | |
parent | 377b1b57fcc1809384f2f35a14158045ad58d400 (diff) | |
download | quilttools-453fcb5a5f1323d1be1187ab0499dfd14dd9c6bb.tar.gz |
mb2q: Handle notmuch message ordering correctly
Notmuch provides the messages in a thread in reverse order, except for the
message which is the first one in a thread. This causes the patch ordering
in the resulting patch queue to be reverse.
Insert the mails into the list after thread starting message instead of
queueing them at the end.
Reported-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rwxr-xr-x | mb2q | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -645,7 +645,12 @@ class nm_mbox(object): sys.stderr.write('Failed to read %s (%s)\n' %(fpath, mid)) raise - self.msgs.append((mid, msg)) + # The message iterator is in reverse order + # except for the first mail in the thread + if len(self.msgs) > 0: + self.msgs.insert(1, (mid, msg)) + else: + self.msgs.append((mid, msg)) nmmsg.remove_tag(realtag) except notmuch.NotmuchError as ex: |