tests/test-simple4server.t
changeset 2020 143c8e4dc22d
parent 1838 6942750831bb
child 2046 994d81caec68
equal deleted inserted replaced
2019:996a562b6c9f 2020:143c8e4dc22d
       
     1 
       
     2   $ cat >> $HGRCPATH <<EOF
       
     3   > [defaults]
       
     4   > amend=-d "0 0"
       
     5   > [web]
       
     6   > push_ssl = false
       
     7   > allow_push = *
       
     8   > [phases]
       
     9   > publish = False
       
    10   > [experimental]
       
    11   > bundle2-exp=False # < Mercurial-4.0
       
    12   > [devel]
       
    13   > legacy.exchange=bundle1
       
    14   > [extensions]
       
    15   > EOF
       
    16 
       
    17   $ mkcommit() {
       
    18   >    echo "$1" > "$1"
       
    19   >    hg add "$1"
       
    20   >    hg ci -m "add $1"
       
    21   > }
       
    22 
       
    23 setup repo
       
    24 
       
    25   $ hg init server
       
    26   $ echo "[extensions]" >> ./server/.hg/hgrc
       
    27   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/serveronly.py" >> ./server/.hg/hgrc
       
    28   $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
       
    29   $ cat hg.pid >> $DAEMON_PIDS
       
    30 
       
    31   $ hg clone http://localhost:$HGPORT/ client
       
    32   no changes found
       
    33   updating to branch default
       
    34   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    35   $ cat ./errors.log
       
    36   $ echo "[extensions]" >> ./client/.hg/hgrc
       
    37   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> ./client/.hg/hgrc
       
    38   $ cp -r client other
       
    39 
       
    40 Smoke testing
       
    41 ===============
       
    42 
       
    43   $ cd client
       
    44   $ mkcommit 0
       
    45   $ mkcommit a
       
    46   $ hg push
       
    47   pushing to http://localhost:$HGPORT/
       
    48   searching for changes
       
    49   remote: adding changesets
       
    50   remote: adding manifests
       
    51   remote: adding file changes
       
    52   remote: added 2 changesets with 2 changes to 2 files
       
    53   $ hg pull
       
    54   pulling from http://localhost:$HGPORT/
       
    55   searching for changes
       
    56   no changes found
       
    57   $ cat ../errors.log
       
    58   $ hg pull -R ../other
       
    59   pulling from http://localhost:$HGPORT/
       
    60   requesting all changes
       
    61   adding changesets
       
    62   adding manifests
       
    63   adding file changes
       
    64   added 2 changesets with 2 changes to 2 files
       
    65   pull obsolescence markers
       
    66   (run 'hg update' to get a working copy)
       
    67   $ cat ../errors.log
       
    68   $ hg push -R ../other
       
    69   pushing to http://localhost:$HGPORT/
       
    70   searching for changes
       
    71   no changes found
       
    72   [1]
       
    73   $ cat ../errors.log
       
    74 
       
    75 Capacity testing
       
    76 ===================
       
    77 
       
    78   $ curl -s http://localhost:$HGPORT/?cmd=hello
       
    79   capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
       
    80   $ curl -s http://localhost:$HGPORT/?cmd=capabilities
       
    81   * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
       
    82 
       
    83   $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort
       
    84   bookmarks	
       
    85   namespaces	
       
    86   obsolete	
       
    87   phases	
       
    88 
       
    89 Push
       
    90 =============
       
    91 
       
    92   $ echo 'A' > a
       
    93   $ hg amend
       
    94   $ hg push
       
    95   pushing to http://localhost:$HGPORT/
       
    96   searching for changes
       
    97   remote: adding changesets
       
    98   remote: adding manifests
       
    99   remote: adding file changes
       
   100   remote: added 1 changesets with 1 changes to 1 files (+1 heads)
       
   101   pushing 2 obsolescence markers (* bytes) (glob)
       
   102   remote: 2 obsolescence markers added
       
   103   $ cat ../errors.log
       
   104   $ hg push
       
   105   pushing to http://localhost:$HGPORT/
       
   106   searching for changes
       
   107   no changes found
       
   108   [1]
       
   109   $ cat ../errors.log
       
   110 
       
   111 Pull
       
   112 =============
       
   113 
       
   114   $ hg -R ../other pull
       
   115   pulling from http://localhost:$HGPORT/
       
   116   searching for changes
       
   117   adding changesets
       
   118   adding manifests
       
   119   adding file changes
       
   120   added 1 changesets with 1 changes to [12] files \(\+1 heads\) (re)
       
   121   pull obsolescence markers
       
   122   2 obsolescence markers added
       
   123   (run 'hg heads' to see heads)
       
   124   $ cat ../errors.log
       
   125   $ hg -R ../other pull
       
   126   pulling from http://localhost:$HGPORT/
       
   127   searching for changes
       
   128   no changes found
       
   129   $ cat ../errors.log
       
   130 
       
   131   $ cd ..
       
   132 
       
   133 Test disabling obsolete advertisement
       
   134 ===========================================
       
   135 (used by bitbucket to select which repo use evolve)
       
   136 
       
   137   $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort
       
   138   bookmarks	
       
   139   namespaces	
       
   140   obsolete	
       
   141   phases	
       
   142   $ curl -s http://localhost:$HGPORT/?cmd=hello
       
   143   capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
       
   144   $ curl -s http://localhost:$HGPORT/?cmd=capabilities
       
   145   * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
       
   146 
       
   147   $ echo '[__temporary__]' >> server/.hg/hgrc
       
   148   $ echo 'advertiseobsolete=False' >> server/.hg/hgrc
       
   149   $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
       
   150   $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
       
   151   $ cat hg.pid >> $DAEMON_PIDS
       
   152 
       
   153   $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort
       
   154   bookmarks	
       
   155   namespaces	
       
   156   phases	
       
   157   $ curl -s http://localhost:$HGPORT/?cmd=hello | grep _evoext_pushobsmarkers_0
       
   158   [1]
       
   159   $ curl -s http://localhost:$HGPORT/?cmd=capabilities | grep _evoext_pushobsmarkers_0
       
   160   [1]
       
   161 
       
   162   $ echo 'advertiseobsolete=True' >> server/.hg/hgrc
       
   163   $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
       
   164   $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
       
   165   $ cat hg.pid >> $DAEMON_PIDS
       
   166 
       
   167   $ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort
       
   168   bookmarks	
       
   169   namespaces	
       
   170   obsolete	
       
   171   phases	
       
   172   $ curl -s http://localhost:$HGPORT/?cmd=hello
       
   173   capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
       
   174   $ curl -s http://localhost:$HGPORT/?cmd=capabilities
       
   175   * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)