I'm currently trying to figure out why winbuild is building a hg.exe
that still wants to call set_binary, even though the file hg was changed
in mercurial's 659f34b833b9 to use setbinary
$ hg version
Traceback (most recent call last):
File "hg", line 34, in <module>
File "mercurial\demandimport.pyo", line 76, in __getattribute__
AttributeError: 'module' object has no attribute 'set_binary'
Build done was:
$ python setup.py --thg-unstable
thg/contrib/hg
--
Steve Borho
Ah. Thanks :-)
I've pushed this one to thg default:
# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1304718990 -7200
# Node ID 9add2d4511ce4f1395be4029575cfd29040442c1
# Parent 1a6efc20ee31f0306079f9ee6b9216847f20e015
contrib/hg: mercurial.util.set_binary was renamed to setbinary
diff --git a/contrib/hg b/contrib/hg
--- a/contrib/hg
+++ b/contrib/hg
@@ -30,7 +30,13 @@
import mercurial.util
import mercurial.dispatch
+def _setbinary(fp):
+ if hasattr(mercurial.util, 'setbinary'):
+ return mercurial.util.setbinary(fp) # >= 1.9
+ else:
+ return mercurial.util.set_binary(fp)
+
for fp in (sys.stdin, sys.stdout, sys.stderr):
- mercurial.util.set_binary(fp)
+ _setbinary(fp)
mercurial.dispatch.run()