[PATCH 1 of 2] cat: record the current behavior of wildcard matches in subrepos

Yuya Nishihara yuya at tcha.org
Sat Nov 25 07:35:03 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1511591374 -32400
#      Sat Nov 25 15:29:34 2017 +0900
# Node ID 38e952030f0c4746257280d47f0f94b6cb9ddb41
# Parent  8287df8b7be545fdafa22b771012ac65f6264d12
cat: record the current behavior of wildcard matches in subrepos

It appears that Mercurial subrepo supports any match patterns.

diff --git a/mercurial/help/subrepos.txt b/mercurial/help/subrepos.txt
--- a/mercurial/help/subrepos.txt
+++ b/mercurial/help/subrepos.txt
@@ -90,7 +90,7 @@ Interaction with Mercurial Commands
 :archive: archive does not recurse in subrepositories unless
     -S/--subrepos is specified.
 
-:cat: cat currently only handles exact file matches in subrepos.
+:cat: cat currently only handles exact file matches in Git subrepos.
     Subversion subrepositories are currently ignored.
 
 :commit: commit creates a consistent snapshot of the state of the
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -1071,6 +1071,18 @@ Prepare a repo with subrepo
     "path": "sub/repo/foo"
    }
   ]
+
+ non-exact match:
+
+  $ hg cat -T '{path}\n' 'glob:**'
+  .hgsub
+  .hgsubstate
+  sub/repo/foo (glob)
+  $ hg cat -T '{path}\n' 're:^sub'
+  sub/repo/foo (glob)
+
+ missing subrepos in working directory:
+
   $ mkdir -p tmp/sub/repo
   $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
   $ cat tmp/sub/repo/foo_p


More information about the Mercurial-devel mailing list