# HG changeset patch # User Matt Mackall # Date 1435171287 18000 # Node ID ff5172c830022b64cc5bd1bae36b2276e9dc6e5d # Parent 20de1ace07a9f0f1315514b0356dc49d5b97c509# Parent 6047b60cdd0984b60191bdb3b272d87c2691ffe4 merge with stable diff -r 20de1ace07a9 -r ff5172c83002 mercurial/match.py --- a/mercurial/match.py Tue Jun 23 22:20:01 2015 -0700 +++ b/mercurial/match.py Wed Jun 24 13:41:27 2015 -0500 @@ -505,6 +505,8 @@ if kind == 're': return pat if kind == 'path': + if pat == '.': + return '' return '^' + util.re.escape(pat) + '(?:/|$)' if kind == 'relglob': return '(?:|.*/)' + _globre(pat) + globsuffix diff -r 20de1ace07a9 -r ff5172c83002 mercurial/templater.py --- a/mercurial/templater.py Tue Jun 23 22:20:01 2015 -0700 +++ b/mercurial/templater.py Wed Jun 24 13:41:27 2015 -0500 @@ -47,7 +47,7 @@ s = pos while pos < end: # find closing quote d = program[pos] - if decode and d == '\\': # skip over escaped characters + if d == '\\': # skip over escaped characters pos += 2 continue if d == c: @@ -450,7 +450,7 @@ # i18n: "revset" is a keyword raise error.ParseError(_("revset expects one or more arguments")) - raw = args[0][1] + raw = stringify(args[0][0](context, mapping, args[0][1])) ctx = mapping['ctx'] repo = ctx.repo() diff -r 20de1ace07a9 -r ff5172c83002 tests/test-command-template.t --- a/tests/test-command-template.t Tue Jun 23 22:20:01 2015 -0700 +++ b/tests/test-command-template.t Wed Jun 24 13:41:27 2015 -0500 @@ -2849,6 +2849,17 @@ <>\n<]> <>\n< +Test string escaping of quotes: + + $ hg log -Ra -r0 -T '{"\""}\n' + " + $ hg log -Ra -r0 -T '{"\\\""}\n' + \" + $ hg log -Ra -r0 -T '{r"\""}\n' + \" + $ hg log -Ra -r0 -T '{r"\\\""}\n' + \\\" + Test exception in quoted template. single backslash before quotation mark is stripped before parsing: @@ -3121,6 +3132,9 @@ Rev: 0 Ancestor: 0 + $ hg log --template '{revset("TIP"|lower)}\n' -l1 + 2 + Test active bookmark templating $ hg book foo diff -r 20de1ace07a9 -r ff5172c83002 tests/test-locate.t --- a/tests/test-locate.t Tue Jun 23 22:20:01 2015 -0700 +++ b/tests/test-locate.t Wed Jun 24 13:41:27 2015 -0500 @@ -106,6 +106,19 @@ $ mkdir otherdir $ cd otherdir + $ hg files path: + ../b (glob) + ../dir.h/foo (glob) + ../t.h (glob) + ../t/e.h (glob) + ../t/x (glob) + $ hg files path:. + ../b (glob) + ../dir.h/foo (glob) + ../t.h (glob) + ../t/e.h (glob) + ../t/x (glob) + $ hg locate b ../b (glob) ../t/b (glob)