New standalone Windows release

Matt Mackall mpm at selenic.com
Fri Sep 23 19:25:04 CDT 2005


On Fri, Sep 23, 2005 at 12:40:27PM -0700, Maquelin, Olivier wrote:
> > -----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.

If you can make a function that wraps both the select and peek
versions in util.py, I can integrate it.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list