tests/test-subrepo-paths.t
author Idan Kamara <idankk86@gmail.com>
Sat, 30 Jul 2011 23:41:10 +0300
branchstable
changeset 14993 e5b2ee5157ae
parent 13582 4f5b269f4ce6
child 15150 91dc8878f888
permissions -rw-r--r--
hook: be prepared for __stdout/err__ not having fileno() it may have been replaced, see https://bitbucket.org/tortoisehg/thg/issue/937

  $ 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 cumulative remapping, the $HGRCPATH file is loaded first

  $ echo '[subpaths]' >> $HGRCPATH
  $ echo 'libfoo = libbar' >> $HGRCPATH
  $ hg debugsub
  path sub
   source   C:\libs\bar-lib\
   revision 

test bad subpaths pattern

  $ cat > .hg/hgrc <<EOF
  > [subpaths]
  > .* = \1
  > EOF
  $ hg debugsub
  abort: bad subrepository pattern in $TESTTMP/outer/.hg/hgrc:2: invalid group reference
  [255]