tests/test-push-http.t
branchstable
changeset 36242 477280637646
parent 36241 fefd57bd9573
child 36243 c19e66dacaa1
equal deleted inserted replaced
36241:fefd57bd9573 36242:477280637646
     1 #require killdaemons
     1 #require killdaemons
       
     2 
       
     3 #testcases bundle1 bundle2
       
     4 
       
     5 #if bundle1
       
     6   $ cat << EOF >> $HGRCPATH
       
     7   > [devel]
       
     8   > # This test is dedicated to interaction through old bundle
       
     9   > legacy.exchange = bundle1
       
    10   > EOF
       
    11 #endif
     2 
    12 
     3   $ hg init test
    13   $ hg init test
     4   $ cd test
    14   $ cd test
     5   $ echo a > a
    15   $ echo a > a
     6   $ hg ci -Ama
    16   $ hg ci -Ama
    74   remote: adding manifests
    84   remote: adding manifests
    75   remote: adding file changes
    85   remote: adding file changes
    76   remote: added 1 changesets with 1 changes to 1 files
    86   remote: added 1 changesets with 1 changes to 1 files
    77   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
    87   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
    78   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
    88   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
    79   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
    89   remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !)
       
    90   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !)
    80   % serve errors
    91   % serve errors
    81   $ hg rollback
    92   $ hg rollback
    82   repository tip rolled back to revision 0 (undo serve)
    93   repository tip rolled back to revision 0 (undo serve)
    83 
    94 
    84 expect success, server lacks the httpheader capability
    95 expect success, server lacks the httpheader capability
    92   remote: adding manifests
   103   remote: adding manifests
    93   remote: adding file changes
   104   remote: adding file changes
    94   remote: added 1 changesets with 1 changes to 1 files
   105   remote: added 1 changesets with 1 changes to 1 files
    95   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   106   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
    96   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
   107   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
    97   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
   108   remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !)
       
   109   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !)
    98   % serve errors
   110   % serve errors
    99   $ hg rollback
   111   $ hg rollback
   100   repository tip rolled back to revision 0 (undo serve)
   112   repository tip rolled back to revision 0 (undo serve)
   101 
   113 
   102 expect success, server lacks the unbundlehash capability
   114 expect success, server lacks the unbundlehash capability
   110   remote: adding manifests
   122   remote: adding manifests
   111   remote: adding file changes
   123   remote: adding file changes
   112   remote: added 1 changesets with 1 changes to 1 files
   124   remote: added 1 changesets with 1 changes to 1 files
   113   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   125   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   114   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
   126   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
   115   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
   127   remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !)
       
   128   remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !)
   116   % serve errors
   129   % serve errors
   117   $ hg rollback
   130   $ hg rollback
   118   repository tip rolled back to revision 0 (undo serve)
   131   repository tip rolled back to revision 0 (undo serve)
   119 
   132 
   120 expect success, pre-d1b16a746db6 server supports the unbundle capability, but
   133 expect success, pre-d1b16a746db6 server supports the unbundle capability, but
   158   > [hooks]
   171   > [hooks]
   159   > prepushkey = sh -c "printenv.py prepushkey 1"
   172   > prepushkey = sh -c "printenv.py prepushkey 1"
   160   > [devel]
   173   > [devel]
   161   > legacy.exchange=phases
   174   > legacy.exchange=phases
   162   > EOF
   175   > EOF
       
   176 
       
   177 #if bundle1
       
   178 
       
   179   $ req
       
   180   pushing to http://localhost:$HGPORT/
       
   181   searching for changes
       
   182   remote: adding changesets
       
   183   remote: adding manifests
       
   184   remote: adding file changes
       
   185   remote: added 1 changesets with 1 changes to 1 files
       
   186   % serve errors
       
   187 
       
   188 #endif
       
   189 
       
   190 #if bundle2
       
   191 
   163   $ req
   192   $ req
   164   pushing to http://localhost:$HGPORT/
   193   pushing to http://localhost:$HGPORT/
   165   searching for changes
   194   searching for changes
   166   remote: adding changesets
   195   remote: adding changesets
   167   remote: adding manifests
   196   remote: adding manifests
   173   remote: rollback completed
   202   remote: rollback completed
   174   abort: updating ba677d0156c1 to public failed
   203   abort: updating ba677d0156c1 to public failed
   175   % serve errors
   204   % serve errors
   176   [255]
   205   [255]
   177 
   206 
       
   207 #endif
       
   208 
   178 expect phase change success
   209 expect phase change success
   179 
   210 
   180   $ cat >> .hg/hgrc <<EOF
   211   $ cat >> .hg/hgrc <<EOF
       
   212   > [hooks]
   181   > prepushkey = sh -c "printenv.py prepushkey 0"
   213   > prepushkey = sh -c "printenv.py prepushkey 0"
   182   > [devel]
   214   > [devel]
   183   > legacy.exchange=
   215   > legacy.exchange=
   184   > EOF
   216   > EOF
   185   $ req
   217 
   186   pushing to http://localhost:$HGPORT/
   218 #if bundle1
   187   searching for changes
   219 
   188   remote: adding changesets
   220   $ req
   189   remote: adding manifests
   221   pushing to http://localhost:$HGPORT/
   190   remote: adding file changes
   222   searching for changes
   191   remote: added 1 changesets with 1 changes to 1 files
   223   no changes found
   192   % serve errors
   224   % serve errors
   193   $ hg rollback
   225   [1]
   194   repository tip rolled back to revision 0 (undo serve)
   226   $ hg rollback
       
   227   repository tip rolled back to revision 0 (undo serve)
       
   228 
       
   229 #endif
       
   230 
       
   231 #if bundle2
       
   232 
       
   233   $ req
       
   234   pushing to http://localhost:$HGPORT/
       
   235   searching for changes
       
   236   remote: adding changesets
       
   237   remote: adding manifests
       
   238   remote: adding file changes
       
   239   remote: added 1 changesets with 1 changes to 1 files
       
   240   % serve errors
       
   241   $ hg rollback
       
   242   repository tip rolled back to revision 0 (undo serve)
       
   243 
       
   244 #endif
   195 
   245 
   196 expect authorization error: all users denied
   246 expect authorization error: all users denied
   197 
   247 
   198   $ echo '[web]' > .hg/hgrc
   248   $ echo '[web]' > .hg/hgrc
   199   $ echo 'push_ssl = false' >> .hg/hgrc
   249   $ echo 'push_ssl = false' >> .hg/hgrc
   212   pushing to http://localhost:$HGPORT/
   262   pushing to http://localhost:$HGPORT/
   213   searching for changes
   263   searching for changes
   214   abort: authorization failed
   264   abort: authorization failed
   215   % serve errors
   265   % serve errors
   216   [255]
   266   [255]
       
   267 
       
   268 #if bundle2
   217 
   269 
   218   $ cat > .hg/hgrc <<EOF
   270   $ cat > .hg/hgrc <<EOF
   219   > [web]
   271   > [web]
   220   > push_ssl = false
   272   > push_ssl = false
   221   > allow_push = *
   273   > allow_push = *
   229   remote: adding manifests
   281   remote: adding manifests
   230   remote: adding file changes
   282   remote: adding file changes
   231   remote: added 1 changesets with 1 changes to 1 files
   283   remote: added 1 changesets with 1 changes to 1 files
   232   % serve errors
   284   % serve errors
   233 
   285 
       
   286 #endif
       
   287 
   234   $ cd ..
   288   $ cd ..