# HG changeset patch
# User Jason <jason@zzq.org>
# Date 1289838782 25200
# Node ID bd974d9e58a2ff06b4671184608a23ced7da31f6
# Parent  0c560be0cd5af8c92434572bf5c63b7c97cda341
Fixed an issue that would raise an exception when using hg 1.7

diff -r 0c560be0cd5a -r bd974d9e58a2 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: