mercurial/util.py
branchstable
changeset 48796 c00d3ce4e94b
parent 48528 75fc2537d93c
child 48870 df56e6bd37f6
equal deleted inserted replaced
48776:b84ff512b645 48796:c00d3ce4e94b
    55 from .utils import (
    55 from .utils import (
    56     compression,
    56     compression,
    57     hashutil,
    57     hashutil,
    58     procutil,
    58     procutil,
    59     stringutil,
    59     stringutil,
    60     urlutil,
       
    61 )
    60 )
    62 
    61 
    63 if pycompat.TYPE_CHECKING:
    62 if pycompat.TYPE_CHECKING:
    64     from typing import (
    63     from typing import (
    65         Iterator,
    64         Iterator,
  2989         mapping[prefix_char] = prefix_char
  2988         mapping[prefix_char] = prefix_char
  2990     r = remod.compile(br'%s(%s)' % (prefix, patterns))
  2989     r = remod.compile(br'%s(%s)' % (prefix, patterns))
  2991     return r.sub(lambda x: fn(mapping[x.group()[1:]]), s)
  2990     return r.sub(lambda x: fn(mapping[x.group()[1:]]), s)
  2992 
  2991 
  2993 
  2992 
  2994 def getport(*args, **kwargs):
       
  2995     msg = b'getport(...) moved to mercurial.utils.urlutil'
       
  2996     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  2997     return urlutil.getport(*args, **kwargs)
       
  2998 
       
  2999 
       
  3000 def url(*args, **kwargs):
       
  3001     msg = b'url(...) moved to mercurial.utils.urlutil'
       
  3002     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3003     return urlutil.url(*args, **kwargs)
       
  3004 
       
  3005 
       
  3006 def hasscheme(*args, **kwargs):
       
  3007     msg = b'hasscheme(...) moved to mercurial.utils.urlutil'
       
  3008     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3009     return urlutil.hasscheme(*args, **kwargs)
       
  3010 
       
  3011 
       
  3012 def hasdriveletter(*args, **kwargs):
       
  3013     msg = b'hasdriveletter(...) moved to mercurial.utils.urlutil'
       
  3014     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3015     return urlutil.hasdriveletter(*args, **kwargs)
       
  3016 
       
  3017 
       
  3018 def urllocalpath(*args, **kwargs):
       
  3019     msg = b'urllocalpath(...) moved to mercurial.utils.urlutil'
       
  3020     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3021     return urlutil.urllocalpath(*args, **kwargs)
       
  3022 
       
  3023 
       
  3024 def checksafessh(*args, **kwargs):
       
  3025     msg = b'checksafessh(...) moved to mercurial.utils.urlutil'
       
  3026     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3027     return urlutil.checksafessh(*args, **kwargs)
       
  3028 
       
  3029 
       
  3030 def hidepassword(*args, **kwargs):
       
  3031     msg = b'hidepassword(...) moved to mercurial.utils.urlutil'
       
  3032     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3033     return urlutil.hidepassword(*args, **kwargs)
       
  3034 
       
  3035 
       
  3036 def removeauth(*args, **kwargs):
       
  3037     msg = b'removeauth(...) moved to mercurial.utils.urlutil'
       
  3038     nouideprecwarn(msg, b'6.0', stacklevel=2)
       
  3039     return urlutil.removeauth(*args, **kwargs)
       
  3040 
       
  3041 
       
  3042 timecount = unitcountfn(
  2993 timecount = unitcountfn(
  3043     (1, 1e3, _(b'%.0f s')),
  2994     (1, 1e3, _(b'%.0f s')),
  3044     (100, 1, _(b'%.1f s')),
  2995     (100, 1, _(b'%.1f s')),
  3045     (10, 1, _(b'%.2f s')),
  2996     (10, 1, _(b'%.2f s')),
  3046     (1, 1, _(b'%.3f s')),
  2997     (1, 1, _(b'%.3f s')),