Patchwork [6,of,7,STABLE] subrepo: add test whether "[paths]" is configured correctly at subrepo creation

login
register
mail settings
Submitter Katsunori FUJIWARA
Date June 19, 2014, 3:43 p.m.
Message ID <f599144d072c808414bc.1403192601@juju>
Download mbox | patch
Permalink /patch/5020/
State Accepted
Commit 0f916db7f297351bbcc61b810db00bfd16bc6303
Headers show

Comments

Katsunori FUJIWARA - June 19, 2014, 3:43 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1403192491 -32400
#      Fri Jun 20 00:41:31 2014 +0900
# Branch stable
# Node ID f599144d072c808414bcab06046b35ae941b9c2f
# Parent  017ffac6f0310a9c5fe82d0d33ae98e99ccefc6b
subrepo: add test whether "[paths]" is configured correctly at subrepo creation

This test is added for changes in the subsequent patch.

This test doesn't use "(glob)" for expected output, because "[paths]"
is configured at subrepo creation by "_abssource()" using
"posixpath.join()" to join path components.

Patch

diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -1359,3 +1359,32 @@  Test that commit --secret works on both 
   $ hg phase -r .
   6: secret
   $ cd ../../
+
+Test that '[paths]' is configured correctly at subrepo creation
+
+  $ cd $TESTTMP/tc
+  $ cat > .hgsub <<EOF
+  > # to clear bogus subrepo path 'bogus=[boguspath'
+  > s = s
+  > t = t
+  > EOF
+  $ hg update -q --clean null
+  $ rm -rf s t
+  $ cat >> .hg/hgrc <<EOF
+  > [paths]
+  > default-push = /foo/bar
+  > EOF
+  $ hg update -q
+  $ cat s/.hg/hgrc
+  [paths]
+  default = $TESTTMP/t/s
+  default-push = /foo/bar/s
+  $ cat s/ss/.hg/hgrc
+  [paths]
+  default = $TESTTMP/t/s/ss
+  default-push = /foo/bar/s/ss
+  $ cat t/.hg/hgrc
+  [paths]
+  default = $TESTTMP/t/t
+  default-push = /foo/bar/t
+  $ cd ..