tests/test-http.t
author Alexander Sauta <demosito@gmail.com>
Sat, 31 Dec 2011 21:54:14 +0300
changeset 15756 ea6940833d71
parent 15446 c5c9ca3719f9
child 16361 6097ede2be4d
permissions -rw-r--r--
i18n-ru: added missing strings in Mercurial help
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15446
c5c9ca3719f9 tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents: 15055
diff changeset
     1
  $ "$TESTDIR/hghave" serve || exit 80
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     3
  $ hg init test
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     4
  $ cd test
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     5
  $ echo foo>foo
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     6
  $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     7
  $ echo foo>foo.d/foo
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     8
  $ echo bar>foo.d/bAr.hg.d/BaR
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
     9
  $ echo bar>foo.d/baR.d.hg/bAR
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    10
  $ hg commit -A -m 1
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    11
  adding foo
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    12
  adding foo.d/bAr.hg.d/BaR
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    13
  adding foo.d/baR.d.hg/bAR
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    14
  adding foo.d/foo
13445
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
    15
  $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    16
  $ hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    17
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    18
Test server address cannot be reused
4289
e17598881509 test-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4130
diff changeset
    19
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    20
  $ hg serve -p $HGPORT1 2>&1
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12446
diff changeset
    21
  abort: cannot start server at ':$HGPORT1': Address already in use
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    22
  [255]
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    23
  $ cd ..
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    24
  $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    25
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    26
clone via stream
9506
49b62395e910 streamclone: partially encode filename over the wire, not for local read (issue1847)
Greg Ward <greg-hg@gerg.ca>
parents: 8167
diff changeset
    27
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    28
  $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    29
  streaming all changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    30
  6 files to transfer, 606 bytes of data
14023
2cd1520664b8 tests: check for (*/sec) instead of (*B/sec) to match (X bytes/sec)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 13445
diff changeset
    31
  transferred * bytes in * seconds (*/sec) (glob)
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    32
  updating to branch default
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    33
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    34
  $ hg verify -R copy
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    35
  checking changesets
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    36
  checking manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    37
  crosschecking files in changesets and manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    38
  checking files
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    39
  4 files, 1 changesets, 4 total revisions
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    40
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    41
try to clone via stream, should use pull instead
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    42
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    43
  $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    44
  requesting all changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    45
  adding changesets
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    46
  adding manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    47
  adding file changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    48
  added 1 changesets with 4 changes to 4 files
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    49
  updating to branch default
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    50
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
2612
ffb895f16925 add support for streaming clone.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    51
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    52
clone via pull
2673
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2622
diff changeset
    53
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    54
  $ hg clone http://localhost:$HGPORT1/ copy-pull
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    55
  requesting all changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    56
  adding changesets
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    57
  adding manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    58
  adding file changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    59
  added 1 changesets with 4 changes to 4 files
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    60
  updating to branch default
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    61
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    62
  $ hg verify -R copy-pull
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    63
  checking changesets
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    64
  checking manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    65
  crosschecking files in changesets and manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    66
  checking files
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    67
  4 files, 1 changesets, 4 total revisions
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    68
  $ cd test
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    69
  $ echo bar > bar
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    70
  $ hg commit -A -d '1 0' -m 2
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    71
  adding bar
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    72
  $ cd ..
2673
109a22f5434a hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2622
diff changeset
    73
14161
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    74
incoming via HTTP
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    75
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    76
  $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    77
  adding changesets
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    78
  adding manifests
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    79
  adding file changes
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    80
  added 1 changesets with 4 changes to 4 files
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    81
  updating to branch default
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    82
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    83
  $ cd partial
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    84
  $ touch LOCAL
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    85
  $ hg ci -qAm LOCAL
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    86
  $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    87
  comparing with http://localhost:$HGPORT1/
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    88
  searching for changes
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    89
  2
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    90
  $ cd ..
8a0fca925992 bundlerepo: fix and improve getremotechanges
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14023
diff changeset
    91
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    92
pull
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    93
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    94
  $ cd copy-pull
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    95
  $ echo '[hooks]' >> .hg/hgrc
13405
682edefe7dbb tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents: 12643
diff changeset
    96
  $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    97
  $ hg pull
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12446
diff changeset
    98
  pulling from http://localhost:$HGPORT1/
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
    99
  searching for changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
   100
  adding changesets
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
   101
  adding manifests
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
   102
  adding file changes
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
   103
  added 1 changesets with 1 changes to 1 files
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 13405
diff changeset
   104
  changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/ 
12446
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
   105
  (run 'hg update' to get a working copy)
df57227a72bf tests: unify test-http
Matt Mackall <mpm@selenic.com>
parents: 10414
diff changeset
   106
  $ cd ..
13445
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   107
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   108
clone from invalid URL
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   109
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   110
  $ hg clone http://localhost:$HGPORT/bad
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   111
  abort: HTTP Error 404: Not Found
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   112
  [255]
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   113
15026
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   114
test http authentication
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   115
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   116
  $ cd test
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   117
  $ cat << EOT > userpass.py
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   118
  > import base64
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   119
  > from mercurial.hgweb import common
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   120
  > def perform_authentication(hgweb, req, op):
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   121
  >     auth = req.env.get('HTTP_AUTHORIZATION')
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   122
  >     if not auth:
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   123
  >         raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   124
  >                 [('WWW-Authenticate', 'Basic Realm="mercurial"')])
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   125
  >     if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: 
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   126
  >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   127
  > def extsetup():
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   128
  >     common.permhooks.insert(0, perform_authentication)
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   129
  > EOT
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   130
  $ hg --config extensions.x=userpass.py serve -p $HGPORT2 -d --pid-file=pid
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   131
  $ cat pid >> $DAEMON_PIDS
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   132
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   133
  $ hg id http://localhost:$HGPORT2/  
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   134
  abort: http authorization required
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   135
  [255]
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   136
  $ hg id http://user@localhost:$HGPORT2/ 
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   137
  abort: http authorization required
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   138
  [255]
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   139
  $ hg id http://user:pass@localhost:$HGPORT2/
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   140
  5fed3813f7f5
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   141
  $ echo '[auth]' >> .hg/hgrc 
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   142
  $ echo 'l.schemes=http' >> .hg/hgrc
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   143
  $ echo 'l.prefix=lo' >> .hg/hgrc
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   144
  $ echo 'l.username=user' >> .hg/hgrc
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   145
  $ echo 'l.password=pass' >> .hg/hgrc
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   146
  $ hg id http://localhost:$HGPORT2/ 
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   147
  5fed3813f7f5
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   148
  $ hg id http://localhost:$HGPORT2/  
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   149
  5fed3813f7f5
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   150
  $ hg id http://user@localhost:$HGPORT2/ 
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   151
  5fed3813f7f5
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   152
  $ hg id http://user:pass@localhost:$HGPORT2/
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   153
  5fed3813f7f5
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   154
  $ hg id http://user2@localhost:$HGPORT2/ 
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   155
  abort: http authorization required
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   156
  [255]
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   157
  $ hg id http://user:pass2@localhost:$HGPORT2/
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   158
  abort: HTTP Error 403: no
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   159
  [255]
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   160
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   161
  $ cd ..
f32a2989ff58 test-http: test http authentication
Mads Kiilerich <mads@kiilerich.com>
parents: 14161
diff changeset
   162
15055
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   163
clone of serve with repo in root and unserved subrepo (issue2970)
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   164
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   165
  $ hg --cwd test init sub
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   166
  $ hg --cwd test/sub tag something
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   167
  $ echo sub = sub > test/.hgsub
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   168
  $ hg --cwd test add .hgsub
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   169
  $ hg --cwd test commit -qm 'add subrepo'
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   170
  $ hg clone http://localhost:$HGPORT noslash-clone
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   171
  requesting all changes
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   172
  adding changesets
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   173
  adding manifests
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   174
  adding file changes
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   175
  added 3 changesets with 7 changes to 7 files
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   176
  updating to branch default
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   177
  abort: HTTP Error 404: Not Found
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   178
  [255]
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   179
  $ hg clone http://localhost:$HGPORT/ slash-clone
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   180
  requesting all changes
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   181
  adding changesets
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   182
  adding manifests
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   183
  adding file changes
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   184
  added 3 changesets with 7 changes to 7 files
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   185
  updating to branch default
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   186
  abort: HTTP Error 404: Not Found
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   187
  [255]
d629f1e89021 subrepo: fix cloning of repos from urls without slash after host (issue2970)
Mads Kiilerich <mads@kiilerich.com>
parents: 15026
diff changeset
   188
13445
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   189
check error log
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   190
61a898576888 hgweb: handle invalid requests with both form data and querystring
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   191
  $ cat error.log