monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: patch: monotone source for mercurial convert extens


From: Maxim Dounin
Subject: [Monotone-devel] Re: patch: monotone source for mercurial convert extension
Date: Sun, 3 Feb 2008 03:24:14 +0300
User-agent: Mutt/1.5.17 (2007-11-01)

Hello!

On Sat, Feb 02, 2008 at 07:39:58PM +0100, Mikkel Fahn??e J??rgensen wrote:

Here is an export from monotone to mercurial.

It is based on the mecurial convert extension in hgext/convert.

Some comments below. And thank you for contribution.

It's my first Python program, so ...

Looks like standard disclaimer here. :)

[...]
+        norepo = NoRepo("%s does not look like a monotone repo" % path)
+        if not os.path.exists(path):
+            raise norepo

It's probably a good idea to use _() here to allow localization of error messages.
[...]
+    def mtncmd(self, arg):
+        cmdline = "mtn -d %s automate %s" % (util.shellquote(self.path), arg)
+        self.ui.debug(cmdline, '\n')
+        p = util.popen(cmdline)
+        result = p.read()
+        if p.close():
+            raise IOError()
+        return result

Please consider using commandline class for this instead. It looks for me that commandline.run0() does exactly what you want. Examples are in darcs_source and svn_sink code.

Maxim Dounin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]