tests/test-extension-isolation.t
branchstable
changeset 4479 2db0aca03a88
child 4643 77f3699e711e
equal deleted inserted replaced
4463:7d54a538dd1e 4479:2db0aca03a88
       
     1 ============================
       
     2 Testing extensions isolation
       
     3 ============================
       
     4 
       
     5 In this test case, we check that a repository using the extensions can co-exist
       
     6 with a repository not using the extension.
       
     7 
       
     8   $ . $TESTDIR/testlib/common.sh
       
     9 
       
    10 Setup
       
    11 =====
       
    12 
       
    13 Create repo
       
    14 
       
    15   $ hg init repo-evo
       
    16   $ cat > repo-evo/.hg/hgrc << EOF
       
    17   > [extensions]
       
    18   > evolve=
       
    19   > EOF
       
    20   $ hg init repo-topic
       
    21   $ cat > repo-topic/.hg/hgrc << EOF
       
    22   > [extensions]
       
    23   > topic=
       
    24   > EOF
       
    25   $ hg init repo-both
       
    26   $ cat > repo-both/.hg/hgrc << EOF
       
    27   > [extensions]
       
    28   > evolve=
       
    29   > topic=
       
    30   > EOF
       
    31   $ hg init repo-no-ext
       
    32 
       
    33 check setup
       
    34 
       
    35   $ hg -R repo-evo  help -e evolve | head -n 1
       
    36   warning: --repository ignored
       
    37   evolve extension - extends Mercurial feature related to Changeset Evolution
       
    38   $ hg -R repo-both  help -e evolve | head -n 1
       
    39   warning: --repository ignored
       
    40   evolve extension - extends Mercurial feature related to Changeset Evolution
       
    41   $ hg -R repo-no-ext help -e evolve
       
    42   warning: --repository ignored
       
    43   abort: no such help topic: evolve
       
    44   (try 'hg help --keyword evolve')
       
    45   [255]
       
    46   $ hg -R repo-no-ext help -e topic
       
    47   warning: --repository ignored
       
    48   abort: no such help topic: topic
       
    49   (try 'hg help --keyword topic')
       
    50   [255]
       
    51 
       
    52 start hgweb dir for all repo
       
    53 
       
    54   $ cat > hgweb.conf << EOF
       
    55   > [paths]
       
    56   > / = *
       
    57   > EOF
       
    58 
       
    59   $ hg serve -p $HGPORT -d --pid-file=hg.pid --web-conf hgweb.conf -A access.log -E error.log
       
    60   $ cat hg.pid >> $DAEMON_PIDS
       
    61 
       
    62 Test isolation
       
    63 --------------
       
    64 
       
    65 As of 4.9 (and previous version). It seems like extensions are displayed as
       
    66 enabled even for repository where they are not supposed to be. See the output
       
    67 tagged `no-false`.
       
    68 
       
    69 (however, topic and evolve are not supposed to affect other repository as shown
       
    70 in the rest of this test).
       
    71 
       
    72   $ get-with-headers.py $LOCALIP:$HGPORT 'repo-no-ext/help/extensions' | grep 'enabled extensions' -A 7
       
    73   [1]
       
    74   $ get-with-headers.py $LOCALIP:$HGPORT 'repo-evo/help/extensions' | grep 'enabled extensions' -A 7
       
    75   enabled extensions:
       
    76   </p>
       
    77   <dl>
       
    78    <dt>evolve
       
    79    <dd>extends Mercurial feature related to Changeset Evolution
       
    80   </dl>
       
    81   <p>
       
    82   disabled extensions:
       
    83   $ get-with-headers.py $LOCALIP:$HGPORT 'repo-topic/help/extensions' | grep 'enabled extensions' -A 7
       
    84   enabled extensions:
       
    85   </p>
       
    86   <dl>
       
    87    <dt>evolve (no-false !)
       
    88    <dd>extends Mercurial feature related to Changeset Evolution (no-false !)
       
    89    <dt>topic
       
    90    <dd>support for topic branches
       
    91   </dl>
       
    92   $ get-with-headers.py $LOCALIP:$HGPORT 'repo-both/help/extensions' | grep 'enabled extensions' -A 9
       
    93   enabled extensions:
       
    94   </p>
       
    95   <dl>
       
    96    <dt>evolve
       
    97    <dd>extends Mercurial feature related to Changeset Evolution
       
    98    <dt>topic
       
    99    <dd>support for topic branches
       
   100   </dl>
       
   101   <p>
       
   102   disabled extensions:
       
   103   $ get-with-headers.py $LOCALIP:$HGPORT 'repo-no-ext/help/extensions' | grep 'enabled extensions' -A 9
       
   104   enabled extensions: (no-false !)
       
   105   </p> (no-false !)
       
   106   <dl> (no-false !)
       
   107    <dt>evolve (no-false !)
       
   108    <dd>extends Mercurial feature related to Changeset Evolution (no-false !)
       
   109    <dt>topic (no-false !)
       
   110    <dd>support for topic branches (no-false !)
       
   111   </dl> (no-false !)
       
   112   <p> (no-false !)
       
   113   disabled extensions: (no-false !)
       
   114 
       
   115 make sure repos don't affect each other (and check both ways)
       
   116 
       
   117 Check evolve isolation
       
   118 -----------------------
       
   119 
       
   120   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
       
   121   [1]
       
   122   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext'
       
   123     _evoext_getbundle_obscommon
       
   124     _evoext_obshash_0
       
   125     _evoext_obshash_1
       
   126     _evoext_obshashrange_v1
       
   127   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
       
   128   [1]
       
   129 
       
   130 Check topic isolation
       
   131 ---------------------
       
   132 
       
   133   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
       
   134   [1]
       
   135   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-topic | egrep 'topics|evoext'
       
   136     topics
       
   137   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
       
   138   [1]
       
   139 
       
   140 Check coupled isolation
       
   141 -----------------------
       
   142 
       
   143   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
       
   144   [1]
       
   145   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-both | egrep 'topics|evoext'
       
   146     _evoext_getbundle_obscommon
       
   147     _evoext_obshash_0
       
   148     _evoext_obshash_1
       
   149     _evoext_obshashrange_v1
       
   150     topics
       
   151   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext'
       
   152     _evoext_getbundle_obscommon
       
   153     _evoext_obshash_0
       
   154     _evoext_obshash_1
       
   155     _evoext_obshashrange_v1
       
   156   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-topic | egrep 'topics|evoext'
       
   157     topics
       
   158   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext'
       
   159     _evoext_getbundle_obscommon
       
   160     _evoext_obshash_0
       
   161     _evoext_obshash_1
       
   162     _evoext_obshashrange_v1
       
   163   $ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
       
   164   [1]
       
   165 
       
   166 Final cleanup
       
   167 -------------
       
   168 
       
   169   $ cat error.log
       
   170 
       
   171   $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS