tests/test-subrepo-paths.t
author Brodie Rao <brodie@bitheap.org>
Wed, 22 Sep 2010 16:06:02 -0500
changeset 12376 97ffc68f71d3
parent 12375 02990e22150b
child 12587 e3247ceaca5e
permissions -rw-r--r--
tests: add glob matching for unified tests This adds a " (glob)" marker that works like a simpler version of (re): "*" is converted to ".*", and "?" is converted to ".". Both special characters can be escaped using "\", and the backslash itself can be escaped as well. Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't supported.

  $ hg init outer
  $ cd outer

hg debugsub with no remapping

  $ echo 'sub = http://example.net/libfoo' > .hgsub
  $ hg add .hgsub

  $ hg debugsub
  path sub
   source   http://example.net/libfoo
   revision 

hg debugsub with remapping

  $ echo '[subpaths]' > .hg/hgrc
  $ printf 'http://example.net/lib(.*) = C:\\libs\\\\1-lib\\\n' >> .hg/hgrc

  $ hg debugsub
  path sub
   source   C:\libs\foo-lib\
   revision 

test bad subpaths pattern

  $ cat > .hg/hgrc <<EOF
  > [subpaths]
  > .* = \1
  > EOF
  $ hg debugsub
  abort: bad subrepository pattern in */test-subrepo-paths.t/outer/.hg/hgrc:2: invalid group reference (glob)
  [255]