[PATCH 1 of 2 v2] test-hgignore.t: add tests for comments

Bryan O'Sullivan bos at serpentine.com
Fri Dec 11 05:34:01 UTC 2015


# HG changeset patch
# User Bryan O'Sullivan <bos at serpentine.com>
# Date 1449811939 28800
#      Thu Dec 10 21:32:19 2015 -0800
# Node ID dea2f8f8a033c13083fe04609bf014b2f58dfcf3
# Parent  df9b73d2d444ae82fe8d3fe6cf682a93b2c4a7ef
test-hgignore.t: add tests for comments

Although support for comments in hgignore files has existed for a
while, it was previously untested.

diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t
--- a/tests/test-hgignore.t
+++ b/tests/test-hgignore.t
@@ -55,6 +55,23 @@ Should display baz only:
   ? a.c
   ? syntax
 
+Ensure that comments work:
+
+  $ touch 'foo#bar' 'quux#' 'baz\#wat'
+  $ cat <<'EOF' >> .hgignore
+  > # full-line comment
+  >   # whitespace-only comment line
+  > syntax# pattern, no whitespace, then comment
+  > a.c  # pattern, then whitespace, then comment
+  > baz\\# # escaped comment character
+  > foo\#b # escaped comment character
+  > quux\## escaped comment character at end of name
+  > EOF
+  $ hg status
+  A dir/b.o
+  ? .hgignore
+  $ rm 'foo#bar' 'quux#' 'baz\#wat'
+
 Check it does not ignore the current directory '.':
 
   $ echo "^\." > .hgignore


More information about the Mercurial-devel mailing list