mercurial/util.py
changeset 35754 fb0be099063f
parent 35582 72b91f905065
child 35755 2384523cee4d
equal deleted inserted replaced
35753:069df0b952e8 35754:fb0be099063f
  3863         return fn
  3863         return fn
  3864     for n in itertools.count(1):
  3864     for n in itertools.count(1):
  3865         fn = '%s~%s~%s' % (f, tag, n)
  3865         fn = '%s~%s~%s' % (f, tag, n)
  3866         if fn not in ctx and fn not in others:
  3866         if fn not in ctx and fn not in others:
  3867             return fn
  3867             return fn
       
  3868 
       
  3869 def readexactly(stream, n):
       
  3870     '''read n bytes from stream.read and abort if less was available'''
       
  3871     s = stream.read(n)
       
  3872     if len(s) < n:
       
  3873         raise error.Abort(_("stream ended unexpectedly"
       
  3874                            " (got %d bytes, expected %d)")
       
  3875                           % (len(s), n))
       
  3876     return s