Fixed an issue that would raise an exception when using hg 1.7
authorJason <jason@zzq.org>
Mon, 15 Nov 2010 09:33:02 -0700
changeset 52 bd974d9e58a2
parent 51 0c560be0cd5a
child 53 c379bed603c6
Fixed an issue that would raise an exception when using hg 1.7
artemis.py
--- a/artemis.py	Mon Mar 08 01:39:04 2010 +0300
+++ b/artemis.py	Mon Nov 15 09:33:02 2010 -0700
@@ -2,7 +2,7 @@
 
 """A very simple and lightweight issue tracker for Mercurial."""
 
-from mercurial import hg, util
+from mercurial import hg, util, commands
 from mercurial.i18n import _
 import os, time, random, mailbox, glob, socket, ConfigParser
 import mimetypes
@@ -169,7 +169,8 @@
         outer.add_header('Message-Id', "<%s-%s-artemis@%s>" % (issue_id, _random_id(), socket.gethostname()))
         outer.add_header('References', mbox[(comment < len(mbox) and keys[comment]) or root]['Message-Id'])
         outer.add_header('In-Reply-To', mbox[(comment < len(mbox) and keys[comment]) or root]['Message-Id'])
-    repo.add([issue_fn[(len(repo.root)+1):] + '/new/'  + mbox.add(outer)])   # +1 for the trailing /
+    new_bug_path = issue_fn[(len(repo.root)+1):] + '/new/' + mbox.add(outer) # + 1 for the trailing /
+    commands.add(ui, repo, new_bug_path)
 
     # Fix properties in the root message
     if properties: