set_binary rename

201 views
Skip to first unread message

Adrian Buehlmann

unread,
May 6, 2011, 4:56:12 PM5/6/11
to thg...@googlegroups.com
In http://selenic.com/repo/hg/rev/659f34b833b9 I've renamed
util.set_binary to setbinary

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

Steve Borho

unread,
May 6, 2011, 5:29:50 PM5/6/11
to thg...@googlegroups.com

thg/contrib/hg

--
Steve Borho

Adrian Buehlmann

unread,
May 6, 2011, 6:10:22 PM5/6/11
to thg...@googlegroups.com, 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()

Reply all
Reply to author
Forward
0 new messages