tests/test-serve.t
author Angel Ezquerra <angel.ezquerra@gmail.com>
Fri, 06 Sep 2013 00:38:28 +0200
changeset 19811 5e10d41e7b9c
parent 18602 339a3fa19695
child 20008 e54a078153f7
permissions -rw-r--r--
merge: let the user choose to merge, keep local or keep remote subrepo revisions When a subrepo has changed on the local and remote revisions, prompt the user whether it wants to merge those subrepo revisions, keep the local revision or keep the remote revision. Up until now mercurial would always perform a merge on a subrepo that had changed on the local and the remote revisions. This is often inconvenient. For example: - You may want to perform the actual subrepo merge after you have merged the parent subrepo files. - Some subrepos may be considered "read only", in the sense that you are not supposed to add new revisions to them. In those cases "merging a subrepo" means choosing which _existing_ revision you want to use on the merged revision. This is often the case for subrepos that contain binary dependencies (such as DLLs, etc). This new prompt makes mercurial better cope with those common scenarios. Notes: - The default behavior (which is the one that is used when ui is not interactive) remains unchanged (i.e. merge is the default action). - This prompt will be shown even if the ui --tool flag is set. - I don't know of a way to test the "keep local" and "keep remote" options (i.e. to force the test to choose those options). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1378420708 -7200 # Fri Sep 06 00:38:28 2013 +0200 # Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d # Parent 50d721553198cea51c30f53b76d41dc919280097 merge: let the user choose to merge, keep local or keep remote subrepo revisions When a subrepo has changed on the local and remote revisions, prompt the user whether it wants to merge those subrepo revisions, keep the local revision or keep the remote revision. Up until now mercurial would always perform a merge on a subrepo that had changed on the local and the remote revisions. This is often inconvenient. For example: - You may want to perform the actual subrepo merge after you have merged the parent subrepo files. - Some subrepos may be considered "read only", in the sense that you are not supposed to add new revisions to them. In those cases "merging a subrepo" means choosing which _existing_ revision you want to use on the merged revision. This is often the case for subrepos that contain binary dependencies (such as DLLs, etc). This new prompt makes mercurial better cope with those common scenarios. Notes: - The default behavior (which is the one that is used when ui is not interactive) remains unchanged (i.e. merge is the default action). - This prompt will be shown even if the ui --tool flag is set. - I don't know of a way to test the "keep local" and "keep remote" options (i.e. to force the test to choose those options).
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: 13540
diff changeset
     1
  $ "$TESTDIR/hghave" serve || exit 80
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     2
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     3
  $ hgserve()
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     4
  > {
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     5
  >    hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     6
  >        | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     7
  >              -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     8
  >              -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
     9
  >    cat hg.pid >> "$DAEMON_PIDS"
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    10
  >    echo % errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    11
  >    cat errors.log
18602
339a3fa19695 tests: remove last two check-code warnings about killdaemons
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
    12
  >    "$TESTDIR/killdaemons.py" hg.pid
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    13
  > }
4504
c68e6486f295 Add test reproducing a bug in "hg serve -v"
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    14
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    15
  $ hg init test
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    16
  $ cd test
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    17
  $ echo '[web]' > .hg/hgrc
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    18
  $ echo 'accesslog = access.log' >> .hg/hgrc
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    19
  $ echo "port = $HGPORT1" >> .hg/hgrc
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    20
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    21
Without -v
6300
874ca958025b test-serve: replace copy/paste with shell function
Patrick Mezard <pmezard@gmail.com>
parents: 6262
diff changeset
    22
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    23
  $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    24
  $ cat hg.pid >> "$DAEMON_PIDS"
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    25
  $ if [ -f access.log ]; then
16487
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 16364
diff changeset
    26
  >     echo 'access log created - .hg/hgrc respected'
4fe874697a4d tests: fix incorrect markup of continued lines of sh commands
Mads Kiilerich <mads@kiilerich.com>
parents: 16364
diff changeset
    27
  > fi
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    28
  access log created - .hg/hgrc respected
4504
c68e6486f295 Add test reproducing a bug in "hg serve -v"
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    29
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    30
errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    31
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    32
  $ cat errors.log
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    33
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    34
With -v
4835
9858477ed74c serve: respect settings from .hg/hgrc
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4506
diff changeset
    35
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    36
  $ hgserve
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    37
  listening at http://localhost/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    38
  % errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    39
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    40
With -v and -p HGPORT2
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    41
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    42
  $ hgserve -p "$HGPORT2"
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    43
  listening at http://localhost/ (bound to 127.0.0.1:HGPORT2)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    44
  % errors
4504
c68e6486f295 Add test reproducing a bug in "hg serve -v"
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    45
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    46
With -v and -p daytime (should fail because low port)
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
    47
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    48
  $ KILLQUIETLY=Y
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    49
  $ hgserve -p daytime
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    50
  abort: cannot start server at 'localhost:13': Permission denied
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    51
  abort: child process failed to start
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    52
  % errors
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    53
  $ KILLQUIETLY=N
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    54
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    55
With --prefix foo
10633
3318431f2ab4 test-serve: Show if port config and option are correctly used
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6461
diff changeset
    56
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    57
  $ hgserve --prefix foo
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    58
  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    59
  % errors
12076
49463314c24f mail/hgweb: support service names for ports (issue2350)
Brodie Rao <brodie@bitheap.org>
parents: 10633
diff changeset
    60
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    61
With --prefix /foo
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    62
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    63
  $ hgserve --prefix /foo
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    64
  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    65
  % errors
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
    66
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    67
With --prefix foo/
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    68
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    69
  $ hgserve --prefix foo/
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    70
  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    71
  % errors
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
    72
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    73
With --prefix /foo/
5971
6d5ecf824a65 tests for hg serve prefix option
Michele Cella <michele.cella@gmail.com>
parents: 5384
diff changeset
    74
13540
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    75
  $ hgserve --prefix /foo/
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    76
  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
3ecadce9173d tests: convert test-serve to new format
Patrick Mezard <pmezard@gmail.com>
parents: 12578
diff changeset
    77
  % errors
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16487
diff changeset
    78
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16487
diff changeset
    79
  $ cd ..