mercurial/minirst.py
changeset 15121 0ad0ebe67815
parent 15102 a7e375d087f6
child 15122 efa213b14ec0
equal deleted inserted replaced
15120:8e848435673c 15121:0ad0ebe67815
    22 import util, encoding
    22 import util, encoding
    23 from i18n import _
    23 from i18n import _
    24 
    24 
    25 
    25 
    26 def replace(text, substs):
    26 def replace(text, substs):
    27     utext = text.decode(encoding.encoding)
       
    28     for f, t in substs:
    27     for f, t in substs:
    29         utext = utext.replace(f, t)
    28         text = text.replace(f, t)
    30     return utext.encode(encoding.encoding)
    29     return text
    31 
       
    32 
    30 
    33 _blockre = re.compile(r"\n(?:\s*\n)+")
    31 _blockre = re.compile(r"\n(?:\s*\n)+")
    34 
    32 
    35 def findblocks(text):
    33 def findblocks(text):
    36     """Find continuous blocks of lines in text.
    34     """Find continuous blocks of lines in text.