mercurial/subrepoutil.py
changeset 37084 f0b6fbea00cf
parent 36690 b529e640015d
child 37585 df4fd29c0854
equal deleted inserted replaced
37083:f99d64e8a4e4 37084:f0b6fbea00cf
    18     error,
    18     error,
    19     filemerge,
    19     filemerge,
    20     pathutil,
    20     pathutil,
    21     phases,
    21     phases,
    22     util,
    22     util,
       
    23 )
       
    24 from .utils import (
       
    25     stringutil,
    23 )
    26 )
    24 
    27 
    25 nullstate = ('', '', 'empty')
    28 nullstate = ('', '', 'empty')
    26 
    29 
    27 def state(ctx, ui):
    30 def state(ctx, ui):
    72 
    75 
    73     def remap(src):
    76     def remap(src):
    74         for pattern, repl in p.items('subpaths'):
    77         for pattern, repl in p.items('subpaths'):
    75             # Turn r'C:\foo\bar' into r'C:\\foo\\bar' since re.sub
    78             # Turn r'C:\foo\bar' into r'C:\\foo\\bar' since re.sub
    76             # does a string decode.
    79             # does a string decode.
    77             repl = util.escapestr(repl)
    80             repl = stringutil.escapestr(repl)
    78             # However, we still want to allow back references to go
    81             # However, we still want to allow back references to go
    79             # through unharmed, so we turn r'\\1' into r'\1'. Again,
    82             # through unharmed, so we turn r'\\1' into r'\1'. Again,
    80             # extra escapes are needed because re.sub string decodes.
    83             # extra escapes are needed because re.sub string decodes.
    81             repl = re.sub(br'\\\\([0-9]+)', br'\\\1', repl)
    84             repl = re.sub(br'\\\\([0-9]+)', br'\\\1', repl)
    82             try:
    85             try: