revlogstat.py on Windows

Patrick Mézard pmezard at gmail.com
Mon Mar 31 13:33:49 CDT 2008


Adrian Buehlmann a écrit :
> Question from a newbie trying to understand Mercurial source code
> (just asking for my own learning):
> 
> As already posted, I fail to run Matt's revlogstat python script:
> http://selenic.com/pipermail/mercurial/2008-March/018276.html
> 
> I would like to ask if anyone has an idea what's wrong with my setup.
> 
> I have (slightly modified):
> 
> '''
> #!/usr/bin/python
> 
> import sys
> from mercurial import revlog
> 
> def stat(f):
>     r = revlog.revlog(open, f)

Here you want to open the file in binary mode. Just create a function like:

binopen = lambda fn: open(fn, 'rb')

and pass it to revlog instead of "open".


--
Patrick Mézard


More information about the Mercurial mailing list