view tests/test-issue1089.t @ 24966:554d6fcc3c84

templater: strip single backslash before quotation mark in quoted template db7463aa080f fixed the issue of double escapes, but it made the following template fail with syntax error because of <\">. Strictly speaking, <\"> appears to be invalid in non-string part, but we are likely to escape <"> if surrounded by quotes, and we are used to write such templates by trial and error. [templates] sl = "{tags % \"{ifeq(tag,'tip','',label('log.tag', ' {tag}'))}\"}" So, for backward compatibility between 2.8.1 and 3.4, a single backslash before quotation mark is stripped only in quoted template. We don't care for <\"> in string literal in quoted template, which never worked as expected before. template result --------- ------------------------ {\"\"} parse error "{""}" {""} -> <> "{\"\"}" {""} -> <> {"\""} {"\""} -> <"> '{"\""}' {"\""} -> <"> "{"\""}" parse error (don't care)
author Yuya Nishihara <yuya@tcha.org>
date Fri, 08 May 2015 18:11:26 +0900
parents f2719b387380
children 2fc86d92c4a9
line wrap: on
line source

http://mercurial.selenic.com/bts/issue1089

  $ hg init
  $ mkdir a
  $ echo a > a/b
  $ hg ci -Am m
  adding a/b

  $ hg rm a
  removing a/b (glob)
  $ hg ci -m m a

  $ mkdir a b
  $ echo a > a/b
  $ hg ci -Am m
  adding a/b

  $ hg rm a
  removing a/b (glob)
  $ cd b

Relative delete:

  $ hg ci -m m ../a

  $ cd ..