tests/test-pull-http.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Fri, 29 May 2015 15:18:49 -0700
changeset 25391 c66d95aa1270
parent 25372 df723a2655e9
child 25405 220a220ed088
permissions -rw-r--r--
test: use bundle2 in test-pull-http This test has a minor output change when using bundle2. We make this change early to reduce the noise in the final change.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 18851
diff changeset
     1
#require killdaemons
4288
8a3e12426c03 test-push-http: use printenv.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2673
diff changeset
     2
25391
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     3
  $ cat << EOF >> $HGRCPATH
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     4
  > [experimental]
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     5
  > # drop me once bundle2 is the default,
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     6
  > # added to get test change early.
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     7
  > bundle2-exp = True
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     8
  > EOF
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
     9
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    10
  $ hg init test
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    11
  $ cd test
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    12
  $ echo a > a
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    13
  $ hg ci -Ama
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    14
  adding a
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    15
  $ cd ..
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    16
  $ hg clone test test2
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    17
  updating to branch default
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    18
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    19
  $ cd test2
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    20
  $ echo a >> a
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    21
  $ hg ci -mb
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
15552
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    23
Cloning with a password in the URL should not save the password in .hg/hgrc:
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    24
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    25
  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    26
  $ cat hg.pid >> $DAEMON_PIDS
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    27
  $ hg clone http://foo:xyzzy@localhost:$HGPORT/ test3
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    28
  requesting all changes
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    29
  adding changesets
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    30
  adding manifests
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    31
  adding file changes
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    32
  added 2 changesets with 2 changes to 1 files
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    33
  updating to branch default
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    34
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    35
  $ cat test3/.hg/hgrc
22837
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    36
  # example repository config (see "hg help config" for more info)
15552
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    37
  [paths]
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    38
  default = http://foo@localhost:$HGPORT/
22837
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    39
  
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    40
  # path aliases to other clones of this repo in URLs or filesystem paths
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    41
  # (see "hg help config.paths" for more info)
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    42
  #
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    43
  # default-push = ssh://jdoe@example.net/hg/jdoes-fork
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    44
  # my-fork      = ssh://jdoe@example.net/hg/jdoes-fork
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    45
  # my-clone     = /home/jdoe/jdoes-clone
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    46
  
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    47
  [ui]
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    48
  # name and email (local to this repository, optional), e.g.
2be7d5ebd4d0 config: use the same hgrc for a cloned repo as for an uninitted repo
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22645
diff changeset
    49
  # username = Jane Doe <jdoe@example.com>
17466
d5a3bda6e170 killdaemons: take file argument explicitely
Patrick Mezard <patrick@mezard.eu>
parents: 16913
diff changeset
    50
  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
15552
62c9183a0bbb clone: don't save user's password in .hg/hgrc (Issue3122)
Augie Fackler <durin42@gmail.com>
parents: 13405
diff changeset
    51
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    52
expect error, cloning not allowed
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    53
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    54
  $ echo '[web]' > .hg/hgrc
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    55
  $ echo 'allowpull = false' >> .hg/hgrc
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    56
  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    57
  $ cat hg.pid >> $DAEMON_PIDS
25372
df723a2655e9 test: use both bundle formats in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22837
diff changeset
    58
  $ hg clone http://localhost:$HGPORT/ test4 --config experimental.bundle2-exp=True
df723a2655e9 test: use both bundle formats in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22837
diff changeset
    59
  requesting all changes
df723a2655e9 test: use both bundle formats in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22837
diff changeset
    60
  abort: authorization failed
df723a2655e9 test: use both bundle formats in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22837
diff changeset
    61
  [255]
df723a2655e9 test: use both bundle formats in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22837
diff changeset
    62
  $ hg clone http://localhost:$HGPORT/ test4 --config experimental.bundle2-exp=False
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    63
  abort: authorization failed
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    64
  [255]
17466
d5a3bda6e170 killdaemons: take file argument explicitely
Patrick Mezard <patrick@mezard.eu>
parents: 16913
diff changeset
    65
  $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    66
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    67
serve errors
6778
959efdac4a9c tests: add some tests for web.allowpull configurations
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6167
diff changeset
    68
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    69
  $ cat errors.log
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    70
  $ req() {
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    71
  >     hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    72
  >     cat hg.pid >> $DAEMON_PIDS
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    73
  >     hg --cwd ../test pull http://localhost:$HGPORT/
17565
f62ed3d90377 tests: enable even more Windows server tests
Patrick Mezard <patrick@mezard.eu>
parents: 17466
diff changeset
    74
  >     "$TESTDIR/killdaemons.py" hg.pid
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    75
  >     echo % serve errors
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    76
  >     cat errors.log
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    77
  > }
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
    78
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    79
expect error, pulling not allowed
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    80
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    81
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12480
diff changeset
    82
  pulling from http://localhost:$HGPORT/
25391
c66d95aa1270 test: use bundle2 in test-pull-http
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25372
diff changeset
    83
  searching for changes
12480
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    84
  abort: authorization failed
4a5048c359d7 tests: unify test-pull-http
Matt Mackall <mpm@selenic.com>
parents: 10398
diff changeset
    85
  % serve errors
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15555
diff changeset
    86
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15555
diff changeset
    87
  $ cd ..