Mercurial > public > mercurial-scm > hg-stable
diff tests/test-censor.t @ 25806:5e18f6e39006
censor: make various path forms available like other Mercurial commands
Before this patch, censored file should be exactly "a path relative to
repository root" regardless of current working directory, because "hg
censor" passes "path" to "repo.file()" directly without any
preparations.
To make various path forms available like other Mercurial commands,
this patch gets a target file path in the way of "hg parents FILE".
Getting "wctx" is relocated to reuse "wctx" for efficiency.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 17 Jul 2015 00:22:16 +0900 |
parents | 8de8cd34f2e3 |
children | 75be14993fda |
line wrap: on
line diff
--- a/tests/test-censor.t Tue Jul 14 14:40:56 2015 +0100 +++ b/tests/test-censor.t Fri Jul 17 00:22:16 2015 +0900 @@ -72,7 +72,10 @@ Censor revision with 2 offenses - $ hg censor -r $C2 -t "remove password" target +(this also tests file pattern matching: path relative to cwd case) + + $ mkdir -p foo/bar/baz + $ hg --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target $ hg cat -r $H1 target Tainted file is now sanitized $ hg cat -r $H2 target @@ -89,7 +92,9 @@ Censor revision with 1 offense - $ hg censor -r $C1 target +(this also tests file pattern matching: with 'path:' scheme) + + $ hg --cwd foo/bar/baz censor -r $C1 path:target $ hg cat -r $H1 target Tainted file is now sanitized $ hg cat -r $H2 target