tests/test-private.t
changeset 7 cc592295900f
parent 6 2ec66dbe2ebe
child 8 e56e40db3225
equal deleted inserted replaced
6:2ec66dbe2ebe 7:cc592295900f
     1   $ cat >> $HGRCPATH <<EOF
     1   $ cat >> $HGRCPATH <<EOF
       
     2   > [web]
       
     3   > push_ssl = false
       
     4   > allow_push = *
     2   > [extensions]
     5   > [extensions]
     3   > EOF
     6   > EOF
     4   $ echo "states=$(echo $(dirname $TESTDIR))/states.py" >> $HGRCPATH
     7   $ echo "states=$(echo $(dirname $TESTDIR))/states.py" >> $HGRCPATH
     5 
     8 
     6   $ hg init local
     9   $ hg init local
   121 
   124 
   122 test on http
   125 test on http
   123 
   126 
   124   $ hg -R local serve -p $HGPORT -d --pid-file=local.pid
   127   $ hg -R local serve -p $HGPORT -d --pid-file=local.pid
   125   $ cat local.pid >> "$DAEMON_PIDS"
   128   $ cat local.pid >> "$DAEMON_PIDS"
   126   $ hg clone http://localhost:$HGPORT/ other3
   129   $ hg clone http://localhost:$HGPORT/ fromhttp
   127   $ hg -R other2 log --template='{rev}:{node|short}\n'
   130   requesting all changes
   128   1:710fe444b3b0
   131   adding changesets
   129   0:5caa672bac26
   132   adding manifests
   130   $ kill `cat local.pid`
   133   adding file changes
       
   134   added 2 changesets with 2 changes to 1 files
       
   135   updating to branch default
       
   136   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   137   $ hg -R fromhttp log --template='{rev}:{node|short}\n'
       
   138   1:710fe444b3b0
       
   139   0:5caa672bac26
       
   140 
       
   141   $ hg init fromhttp2
       
   142   $ cd fromhttp2
       
   143   $ hg inc http://localhost:$HGPORT/ --template='{rev}:{node|short}\n'
       
   144   comparing with http://localhost:$HGPORT/
       
   145   0:5caa672bac26
       
   146   1:710fe444b3b0
       
   147   $ hg pull http://localhost:$HGPORT/
       
   148   pulling from http://localhost:$HGPORT/
       
   149   requesting all changes
       
   150   adding changesets
       
   151   adding manifests
       
   152   adding file changes
       
   153   added 2 changesets with 2 changes to 1 files
       
   154   (run 'hg update' to get a working copy)
       
   155   $ hg log --template='{rev}:{node|short}\n'
       
   156   1:710fe444b3b0
       
   157   0:5caa672bac26
       
   158   $ hg inc http://localhost:$HGPORT/ --template='{rev}:{node|short}\n'
       
   159   comparing with http://localhost:$HGPORT/
       
   160   searching for changes
       
   161   no changes found
       
   162   [1]
       
   163 
       
   164 turn private off again (repo side)
       
   165   $ cd ..
       
   166   $ "$TESTDIR/killdaemons.py"
       
   167   $ sed -i 's/^private=.*$/private=off/' ./local/.hg/hgrc
       
   168   $ hg -R local serve -p $HGPORT -d --pid-file=local.pid
       
   169   $ cat local.pid >> "$DAEMON_PIDS"
       
   170   $ cd fromhttp2
       
   171 
       
   172   $ hg inc http://localhost:$HGPORT/ --template='{rev}:{node|short}\n'
       
   173   comparing with http://localhost:$HGPORT/
       
   174   searching for changes
       
   175   2:3c8695235a32
       
   176   3:73585b17392a
       
   177   $ hg pull http://localhost:$HGPORT/
       
   178   pulling from http://localhost:$HGPORT/
       
   179   searching for changes
       
   180   adding changesets
       
   181   adding manifests
       
   182   adding file changes
       
   183   added 2 changesets with 2 changes to 2 files
       
   184   (run 'hg update' to get a working copy)
       
   185   $ cd ..
       
   186   $ "$TESTDIR/killdaemons.py"
       
   187 
       
   188 turn private on again (repo side)
       
   189   $ sed -i 's/^private=.*$/private=on/' local/.hg/hgrc
       
   190   $ hg init httpto
       
   191   $ hg -R httpto serve -p $HGPORT -d --pid-file=remote.pid
       
   192   $ cat remote.pid >> "$DAEMON_PIDS"
       
   193   $ cd local
       
   194   $ hg out http://localhost:$HGPORT/  --template='{rev}:{node|short}\n'
       
   195   comparing with http://localhost:$HGPORT/
       
   196   searching for changes
       
   197   0:5caa672bac26
       
   198   1:710fe444b3b0
       
   199   $ hg push http://localhost:$HGPORT/
       
   200   pushing to http://localhost:$HGPORT/
       
   201   searching for changes
       
   202   remote: adding changesets
       
   203   remote: adding manifests
       
   204   remote: adding file changes
       
   205   remote: added 2 changesets with 2 changes to 1 files
       
   206   $ "$TESTDIR/killdaemons.py"