diff mercurial/sshrepo.py @ 3034:2b0bc36a48d8

sshrepo: flush stderr before connecting to the hg server
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 02 Sep 2006 21:08:54 +0200
parents 345bac2bc4ec
children adf7f3421c55
line wrap: on
line diff
--- a/mercurial/sshrepo.py	Thu Aug 31 12:51:02 2006 -0500
+++ b/mercurial/sshrepo.py	Sat Sep 02 21:08:54 2006 +0200
@@ -52,6 +52,9 @@
         return self._url
 
     def validate_repo(self, ui, sshcmd, args, remotecmd):
+        # cleanup up previous run
+        self.cleanup()
+
         cmd = '%s %s "%s -R %s serve --stdio"'
         cmd = cmd % (sshcmd, args, remotecmd, self.path)
 
@@ -90,7 +93,7 @@
             if not l: break
             self.ui.status(_("remote: "), l)
 
-    def __del__(self):
+    def cleanup(self):
         try:
             self.pipeo.close()
             self.pipei.close()
@@ -101,6 +104,8 @@
         except:
             pass
 
+    __del__ = cleanup
+
     def do_cmd(self, cmd, **args):
         self.ui.debug(_("sending %s command\n") % cmd)
         self.pipeo.write("%s\n" % cmd)