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