mercurial/util.py
changeset 6507 9699864de219
parent 6501 4f7feeb6d6ee
child 6548 962eb403165b
equal deleted inserted replaced
6506:850071c017fa 6507:9699864de219
   241         if cmd.startswith(name):
   241         if cmd.startswith(name):
   242             return fn(s, cmd[len(name):].lstrip())
   242             return fn(s, cmd[len(name):].lstrip())
   243     return pipefilter(s, cmd)
   243     return pipefilter(s, cmd)
   244 
   244 
   245 def binary(s):
   245 def binary(s):
   246     """return true if a string is binary data using diff's heuristic"""
   246     """return true if a string is binary data"""
   247     if s and '\0' in s[:4096]:
   247     if s and '\0' in s:
   248         return True
   248         return True
   249     return False
   249     return False
   250 
   250 
   251 def unique(g):
   251 def unique(g):
   252     """return the uniq elements of iterable g"""
   252     """return the uniq elements of iterable g"""