[PATCH 2 of 4] run-tests: allow to put conditions and comments in expected output

Mads Kiilerich mads at kiilerich.com
Sat Feb 22 13:22:56 CST 2014


On 02/10/2014 04:46 PM, Simon Heimberg wrote:
>> For the file://drive/path handling: Wouldn't it be simpler to add a 
>> replacement hack to run-tests?
>
> I do not know what a replacement hack is, sorry.

...
     replacements = [
         (r':%s\b' % port, ':$HGPORT'),
         (r':%s\b' % (port + 1), ':$HGPORT1'),
         (r':%s\b' % (port + 2), ':$HGPORT2'),
         ]
     if os.name == 'nt':
         replacements.append(
             (''.join(c.isalpha() and '[%s%s]' % (c.lower(), c.upper()) or
                      c in '/\\' and r'[/\\]' or
                      c.isdigit() and c or
                      '\\' + c
                      for c in testtmp), '$TESTTMP'))
     else:
         replacements.append((re.escape(testtmp), '$TESTTMP'))
...

/Mads


More information about the Mercurial-devel mailing list