rename util.set_binary to setbinary
authorAdrian Buehlmann <adrian@cadifra.com>
Fri, 06 May 2011 15:25:35 +0200
changeset 14233 659f34b833b9a9fe629fe31daed5113a2dc3f906
parent 14232 df2399663392c15ae0387f51986a882099fd4663
child 14234 600e64004eb598bac14c0b6856a88917055e1e5e
push id1
push usergszorc@mozilla.com
push dateWed, 18 Mar 2015 16:34:57 +0000
rename util.set_binary to setbinary
contrib/dumprevlog
contrib/simplemerge
contrib/undumprevlog
hg
hgext/convert/subversion.py
mercurial/hgweb/wsgicgi.py
mercurial/posix.py
mercurial/sshserver.py
mercurial/windows.py
--- a/contrib/dumprevlog
+++ b/contrib/dumprevlog
@@ -1,17 +1,17 @@
 #!/usr/bin/env python
 # Dump revlogs as raw data stream
 # $ find .hg/store/ -name "*.i" | xargs dumprevlog > repo.dump
 
 import sys
 from mercurial import revlog, node, util
 
 for fp in (sys.stdin, sys.stdout, sys.stderr):
-    util.set_binary(fp)
+    util.setbinary(fp)
 
 for f in sys.argv[1:]:
     binopen = lambda fn: open(fn, 'rb')
     r = revlog.revlog(binopen, f)
     print "file:", f
     for i in r:
         n = r.node(i)
         p = r.parents(n)
--- a/contrib/simplemerge
+++ b/contrib/simplemerge
@@ -38,17 +38,17 @@ def showhelp():
                                     longopt and ' --%s' % longopt),
                          '%s' % desc))
     opts_len = max([len(opt[0]) for opt in out_opts])
     for first, second in out_opts:
         sys.stdout.write(' %-*s  %s\n' % (opts_len, first, second))
 
 try:
     for fp in (sys.stdin, sys.stdout, sys.stderr):
-        util.set_binary(fp)
+        util.setbinary(fp)
     
     opts = {}
     try:
         args = fancyopts.fancyopts(sys.argv[1:], options, opts)
     except fancyopts.getopt.GetoptError, e:
         raise ParseError(e)
     if opts['help']:
         showhelp()
--- a/contrib/undumprevlog
+++ b/contrib/undumprevlog
@@ -2,17 +2,17 @@
 # Undump a dump from dumprevlog
 # $ hg init
 # $ undumprevlog < repo.dump
 
 import sys
 from mercurial import revlog, node, scmutil, util, transaction
 
 for fp in (sys.stdin, sys.stdout, sys.stderr):
-    util.set_binary(fp)
+    util.setbinary(fp)
 
 opener = scmutil.opener('.', False)
 tr = transaction.transaction(sys.stderr.write, opener, "undump.journal")
 while 1:
     l = sys.stdin.readline()
     if not l:
         break
     if l.startswith("file:"):
--- a/hg
+++ b/hg
@@ -28,11 +28,11 @@ except ImportError:
                      ' '.join(sys.path))
     sys.stderr.write("(check your install and PYTHONPATH)\n")
     sys.exit(-1)
 
 import mercurial.util
 import mercurial.dispatch
 
 for fp in (sys.stdin, sys.stdout, sys.stderr):
-    mercurial.util.set_binary(fp)
+    mercurial.util.setbinary(fp)
 
 mercurial.dispatch.run()
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -107,18 +107,18 @@ def get_log_child(fp, url, paths, start,
     # consumes *huge* amount of memory. The output file being closed,
     # there is no need for clean termination.
     os._exit(0)
 
 def debugsvnlog(ui, **opts):
     """Fetch SVN log in a subprocess and channel them back to parent to
     avoid memory collection issues.
     """
-    util.set_binary(sys.stdin)
-    util.set_binary(sys.stdout)
+    util.setbinary(sys.stdin)
+    util.setbinary(sys.stdout)
     args = decodeargs(sys.stdin.read())
     get_log_child(sys.stdout, *args)
 
 class logstream(object):
     """Interruptible revision log iterator."""
     def __init__(self, stdout):
         self._stdout = stdout
 
--- a/mercurial/hgweb/wsgicgi.py
+++ b/mercurial/hgweb/wsgicgi.py
@@ -8,18 +8,18 @@
 # This was originally copied from the public domain code at
 # http://www.python.org/dev/peps/pep-0333/#the-server-gateway-side
 
 import os, sys
 from mercurial import util
 from mercurial.hgweb import common
 
 def launch(application):
-    util.set_binary(sys.stdin)
-    util.set_binary(sys.stdout)
+    util.setbinary(sys.stdin)
+    util.setbinary(sys.stdout)
 
     environ = dict(os.environ.iteritems())
     environ.setdefault('PATH_INFO', '')
     if environ.get('SERVER_SOFTWARE', '').startswith('Microsoft-IIS'):
         # IIS includes script_name in path_info
         scriptname = environ['SCRIPT_NAME']
         if environ['PATH_INFO'].startswith(scriptname):
             environ['PATH_INFO'] = environ['PATH_INFO'][len(scriptname):]
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -123,17 +123,17 @@ def checklink(path):
     except (OSError, AttributeError):
         return False
 
 def checkosfilename(path):
     '''Check that the base-relative path is a valid filename on this platform.
     Returns None if the path is ok, or a UI string describing the problem.'''
     pass # on posix platforms, every path is ok
 
-def set_binary(fd):
+def setbinary(fd):
     pass
 
 def pconvert(path):
     return path
 
 def localpath(path):
     return path
 
--- a/mercurial/sshserver.py
+++ b/mercurial/sshserver.py
@@ -16,18 +16,18 @@ class sshserver(object):
         self.lock = None
         self.fin = sys.stdin
         self.fout = sys.stdout
 
         hook.redirect(True)
         sys.stdout = sys.stderr
 
         # Prevent insertion/deletion of CRs
-        util.set_binary(self.fin)
-        util.set_binary(self.fout)
+        util.setbinary(self.fin)
+        util.setbinary(self.fout)
 
     def getargs(self, args):
         data = {}
         keys = args.split()
         for n in xrange(len(keys)):
             argline = self.fin.readline()[:-1]
             arg, l = argline.split()
             if arg not in keys:
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -91,17 +91,17 @@ def setflags(f, l, x):
     pass
 
 def checkexec(path):
     return False
 
 def checklink(path):
     return False
 
-def set_binary(fd):
+def setbinary(fd):
     # When run without console, pipes may expose invalid
     # fileno(), usually set to -1.
     if hasattr(fd, 'fileno') and fd.fileno() >= 0:
         msvcrt.setmode(fd.fileno(), os.O_BINARY)
 
 def pconvert(path):
     return '/'.join(path.split(os.sep))