tests/test-push-http.t
author Greg Ward <greg@gerg.ca>
Sun, 18 Sep 2011 19:59:33 -0400
changeset 15131 7c26ce9edbd2
parent 14093 ce99d887585f
child 15446 c5c9ca3719f9
permissions -rw-r--r--
rollback: only restore dirstate and branch when appropriate. If the working dir parent was destroyed by rollback, then the old behaviour is perfectly reasonable: restore dirstate, branch, and bookmarks. That way the working dir moves back to an existing changeset rather than becoming an orphan. But if the working dir parent was unaffected -- say, you updated to an older changeset and then did rollback -- then it's silly to restore dirstate and branch. So don't do that. Leave the status of the working dir alone. (But always restore bookmarks, because that file refers to changeset IDs that may have been destroyed.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     2
  $ hg init test
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     3
  $ cd test
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     4
  $ echo a > a
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     5
  $ hg ci -Ama
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     6
  adding a
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     7
  $ cd ..
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     8
  $ hg clone test test2
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
     9
  updating to branch default
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    10
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    11
  $ cd test2
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    12
  $ echo a >> a
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    13
  $ hg ci -mb
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    14
  $ req() {
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    15
  >     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
    16
  >     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
    17
  >     hg --cwd ../test2 push http://localhost:$HGPORT/
13449
8b1125eb361e test-push-http: use killdaemons.py instead of kill to avoid test unreliability
Gilles Moris <gilles.moris@free.fr>
parents: 13446
diff changeset
    18
  >     "$TESTDIR/killdaemons.py"
12743
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    19
  >     echo % serve errors
4c4aeaab2339 check-code: add 'no tab indent' check for unified tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 12643
diff changeset
    20
  >     cat errors.log
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    21
  > }
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    22
  $ cd ../test
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    24
expect ssl error
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    25
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    26
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
    27
  pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    28
  searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    29
  remote: ssl required
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    30
  % serve errors
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    31
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    32
expect authorization error
6167
f53b9a383476 tests: easier hg serve error diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 5386
diff changeset
    33
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    34
  $ echo '[web]' > .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    35
  $ echo 'push_ssl = false' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    36
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
    37
  pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    38
  searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    39
  abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    40
  % serve errors
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    41
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    42
expect authorization error: must have authorized user
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    43
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    44
  $ echo 'allow_push = unperson' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    45
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
    46
  pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    47
  searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    48
  abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    49
  % serve errors
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    50
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    51
expect success
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    52
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    53
  $ echo 'allow_push = *' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    54
  $ echo '[hooks]' >> .hg/hgrc
13405
682edefe7dbb tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents: 13404
diff changeset
    55
  $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup 0' >> .hg/hgrc
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    56
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
    57
  pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    58
  searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    59
  remote: adding changesets
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    60
  remote: adding manifests
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    61
  remote: adding file changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    62
  remote: added 1 changesets with 1 changes to 1 files
13404
31a256ffe9e5 tests: let printenv.py show the real values
Mads Kiilerich <mads@kiilerich.com>
parents: 12743
diff changeset
    63
  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*:  (glob)
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    64
  % serve errors
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    65
  $ hg rollback
13446
1e497df514e2 rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents: 13405
diff changeset
    66
  repository tip rolled back to revision 0 (undo serve)
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
    67
14093
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    68
expect success, server lacks the httpheader capability
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    69
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    70
  $ CAP=httpheader
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    71
  $ . "$TESTDIR/notcapable"
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    72
  $ req
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    73
  pushing to http://localhost:$HGPORT/
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    74
  searching for changes
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    75
  remote: adding changesets
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    76
  remote: adding manifests
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    77
  remote: adding file changes
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    78
  remote: added 1 changesets with 1 changes to 1 files
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    79
  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*:  (glob)
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    80
  % serve errors
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    81
  $ hg rollback
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    82
  repository tip rolled back to revision 0 (undo serve)
ce99d887585f httprepo: long arguments support (issue2126)
Steven Brown <StevenGBrown@gmail.com>
parents: 14011
diff changeset
    83
13946
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    84
expect success, server lacks the unbundlehash capability
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    85
14011
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13946
diff changeset
    86
  $ CAP=unbundlehash
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13946
diff changeset
    87
  $ . "$TESTDIR/notcapable"
13946
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    88
  $ req
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    89
  pushing to http://localhost:$HGPORT/
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    90
  searching for changes
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    91
  remote: adding changesets
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    92
  remote: adding manifests
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    93
  remote: adding file changes
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    94
  remote: added 1 changesets with 1 changes to 1 files
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    95
  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*:  (glob)
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    96
  % serve errors
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    97
  $ hg rollback
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    98
  repository tip rolled back to revision 0 (undo serve)
3c2f9f611ef6 tests: new test cases for the unbundlehash capability
Steven Brown <StevenGBrown@gmail.com>
parents: 13449
diff changeset
    99
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   100
expect authorization error: all users denied
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   101
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   102
  $ echo '[web]' > .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   103
  $ echo 'push_ssl = false' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   104
  $ echo 'deny_push = *' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   105
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
   106
  pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   107
  searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   108
  abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   109
  % serve errors
2481
5c65b4e51610 add tests for push over http.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   110
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   111
expect authorization error: some users denied, users must be authenticated
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   112
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   113
  $ echo 'deny_push = unperson' >> .hg/hgrc
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   114
  $ req
12643
d08bb64888bc tests: reintroduce ":$HGPORT" in test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12483
diff changeset
   115
  pushing to http://localhost:$HGPORT/
12483
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   116
  searching for changes
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   117
  abort: authorization failed
fecd4966f8d4 tests: unify test-push-http
Matt Mackall <mpm@selenic.com>
parents: 11469
diff changeset
   118
  % serve errors