changeset 35006:8154119ed236

cat: test output path behvaior when target path does not exist In the next patch, we will change the behavior of the cat command to create output file parent directories before attempting to write the output file. This patch documents the current unfortunate behavior. Differential Revision: https://phab.mercurial-scm.org/D1331
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 07 Nov 2017 13:46:15 -0800
parents aad6b9fdfc75
children 407ec7f3ff02
files tests/test-cat.t
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-cat.t	Mon Oct 23 00:06:49 2017 +0530
+++ b/tests/test-cat.t	Tue Nov 07 13:46:15 2017 -0800
@@ -119,3 +119,14 @@
   $ PATTERN='t4' hg log -r '.' -T "{envvars % '{key} -> {value}\n'}" \
   >                 --config "experimental.exportableenviron=PATTERN"
   PATTERN -> t4
+
+Test behavior of output when directory structure does not already exist
+
+  $ mkdir foo
+  $ echo a > foo/a
+  $ hg add foo/a
+  $ hg commit -qm "add foo/a"
+  $ mkdir output
+  $ hg cat --output "output/%p" foo/a
+  abort: No such file or directory: output/foo/a
+  [255]