Patchwork [STABLE,V2] cat: record the current behavior of wildcard matches in subrepos

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 30, 2017, 1:56 p.m.
Message ID <4b139bb31b336c46e1b2.1512050192@mimosa>
Download mbox | patch
Permalink /patch/25831/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 30, 2017, 1:56 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1511591374 -32400
#      Sat Nov 25 15:29:34 2017 +0900
# Branch stable
# Node ID 4b139bb31b336c46e1b2e8f7e9f16a5332868670
# Parent  62539b425347874340380d779fe465b8e9094598
cat: record the current behavior of wildcard matches in subrepos

Mercurial subrepos support any match patterns.
Augie Fackler - Nov. 30, 2017, 8:58 p.m.
On Thu, Nov 30, 2017 at 10:56:32PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1511591374 -32400
> #      Sat Nov 25 15:29:34 2017 +0900
> # Branch stable
> # Node ID 4b139bb31b336c46e1b2e8f7e9f16a5332868670
> # Parent  62539b425347874340380d779fe465b8e9094598
> cat: record the current behavior of wildcard matches in subrepos

queued for stable, thanks

Patch

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: Git subrepositories only support exact file matches.
     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