diff hgext/convert/monotone.py @ 13792:a916e8de4313

convert/mtn: Fix conversion of large files from mtn (broken in ed97955e0c04) "mtn automate stdio" will break output larger than 32kB into several packets. This ensures that we are processing all the output on the main stream and not only the last packet.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 28 Mar 2011 23:16:20 -0400
parents c13bfa451656
children 64481eee6215
line wrap: on
line diff
--- a/hgext/convert/monotone.py	Mon Mar 28 21:36:29 2011 -0700
+++ b/hgext/convert/monotone.py	Mon Mar 28 23:16:20 2011 -0400
@@ -138,7 +138,7 @@
         return (commandnbr, stream, length, read)
 
     def mtnstdioreadcommandoutput(self, command):
-        retval = ''
+        retval = []
         while True:
             commandnbr, stream, length, output = self.mtnstdioreadpacket()
             self.ui.debug('mtn: read packet %s:%s:%s\n' %
@@ -159,9 +159,9 @@
                 self.ui.debug('mtn: ' + output)
             elif stream == 'm':
                 # Main stream - command output
-                retval = output
+                retval.append(output)
 
-        return retval
+        return ''.join(retval)
 
     def mtnloadmanifest(self, rev):
         if self.manifest_rev == rev: