New standalone Windows release

Maquelin, Olivier olivier.maquelin at intel.com
Fri Sep 23 14:40:27 CDT 2005


> -----Original Message-----
> From: mercurial-bounces at selenic.com 
> [mailto:mercurial-bounces at selenic.com] On Behalf Of Zbynek Winkler
> Sent: Friday, September 23, 2005 12:28 PM
> To: mercurial at selenic.com
> Subject: Re: New standalone Windows release
[...]
> I've found 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
>  that uses 
> PeekNamedPipe from win32pipe...

Yes, PeekNamedPipe is also what I found after some googling. Here is a
Windows version of sshrepo.readerr() based on that API:

    def readerr(self):
        hpipee = win32file._get_osfhandle(self.pipee.fileno())
        while 1:
            try:
                buf,avail,ignore = win32pipe.PeekNamedPipe(hpipee, 0)
                if avail <= 0: break
                l = self.pipee.readline()
                if not l: break
                self.ui.status("remote: ", l)
            except Exception, e:
                errno = e[0]
                if errno == 109: # other end disconnected or end of file
                    break
                else:
                    raise

That change would obviously break Linux, but the 'hg pull' command now
works for me under Windows. I also verified that stderr output from the
remote gets reported as it should.

-- Olivier



More information about the Mercurial mailing list