diff hgext/convert/darcs.py @ 17413:97f1f22c2dba stable

convert: use subprocess for all commandline calls Avoid mixing popen and subprocess calls, it simplifies the command line generation and quoting issues with redirections. In practice, it fixes the subversion sink on Windows and probably helps with monotone and darcs sources.
author Patrick Mezard <patrick@mezard.eu>
date Fri, 03 Aug 2012 21:37:33 +0200
parents 363e808de349
children 650b5b6e75ed
line wrap: on
line diff
--- a/hgext/convert/darcs.py	Fri Aug 03 21:05:01 2012 +0200
+++ b/hgext/convert/darcs.py	Fri Aug 03 21:37:33 2012 +0200
@@ -104,9 +104,10 @@
         # possible, etree will still raise an exception if any
         # non-printable characters are in the XML changelog.
         parser = XMLParser(encoding='latin-1')
-        fp = self._run(cmd, **kwargs)
-        etree.parse(fp, parser=parser)
-        self.checkexit(fp.close())
+        p = self._run(cmd, **kwargs)
+        etree.parse(p.stdout, parser=parser)
+        p.wait()
+        self.checkexit(p.returncode)
         return etree.getroot()
 
     def format(self):