Patchwork [STABLE] doctest: convert matcher root to native path

login
register
mail settings
Submitter Yuya Nishihara
Date July 28, 2018, 7:48 a.m.
Message ID <39885c84a7c1fa65637d.1532764132@mimosa>
Download mbox | patch
Permalink /patch/32960/
State Accepted
Headers show

Comments

Yuya Nishihara - July 28, 2018, 7:48 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1532763395 -32400
#      Sat Jul 28 16:36:35 2018 +0900
# Branch stable
# Node ID 39885c84a7c1fa65637d281188c51de06d9c0997
# Parent  5b3b74e4b21442777f741df60fd81e52e220a182
doctest: convert matcher root to native path

Otherwise it wouldn't be caught by a fast path of pathutil.canonpath(), and
fall back to file identity checks.
Augie Fackler - July 30, 2018, 1:43 p.m.
> On Jul 28, 2018, at 03:48, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1532763395 -32400
> #      Sat Jul 28 16:36:35 2018 +0900
> # Branch stable
> # Node ID 39885c84a7c1fa65637d281188c51de06d9c0997
> # Parent  5b3b74e4b21442777f741df60fd81e52e220a182
> doctest: convert matcher root to native path

Queued for stable, thanks.

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -692,7 +692,7 @@  class prefixdirmatcher(basematcher):
     The prefix path should usually be the relative path from the root of
     this matcher to the root of the wrapped matcher.
 
-    >>> m1 = match(b'root/d/e', b'f', [b'../a.txt', b'b.txt'])
+    >>> m1 = match(util.localpath(b'root/d/e'), b'f', [b'../a.txt', b'b.txt'])
     >>> m2 = prefixdirmatcher(b'root', b'd/e/f', b'd/e', m1)
     >>> bool(m2(b'a.txt'),)
     False