tests/test-bad-pull.t
author David Soria Parra <dsp@experimentalworks.net>
Thu, 29 Aug 2013 09:22:13 -0700
changeset 19854 49d4919d21c2
parent 17019 5d0538599428
child 22046 7a9cbb315d84
permissions -rw-r--r--
shelve: add a shelve extension to save/restore working changes This extension saves shelved changes using a temporary draft commit, and bundles the temporary commit and its draft ancestors, then strips them. This strategy makes it possible to use Mercurial's bundle and merge machinery to resolve conflicts if necessary when unshelving, even when the destination commit or its ancestors have been amended, squashed, or evolved. (Once a change has been unshelved, its associated unbundled commits are either rolled back or stripped.) Storing the shelved change as a bundle also avoids the difficulty that hidden commits would cause, of making it impossible to amend the parent if it is a draft commits (a common scenario). Although this extension shares its name and some functionality with the third party hgshelve extension, it has little else in common. Notably, the hgshelve extension shelves changes as unified diffs, which makes conflict resolution a matter of finding .rej files and conflict markers, and cleaning up the mess by hand. We do not yet allow hunk-level choosing of changes to record. Compared to the hgshelve extension, this is a small regression in usability, but we hope to integrate that at a later point, once the record machinery becomes more reusable and robust.
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: 12376
diff changeset
     1
  $ "$TESTDIR/hghave" serve || exit 80
c5c9ca3719f9 tests: use 'hghave serve' to guard tests that requires serve daemon management
Mads Kiilerich <mads@kiilerich.com>
parents: 12376
diff changeset
     2
17019
5d0538599428 test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16496
diff changeset
     3
#if windows
5d0538599428 test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16496
diff changeset
     4
  $ hg clone http://localhost:$HGPORT/ copy
5d0538599428 test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16496
diff changeset
     5
  abort: * (glob)
5d0538599428 test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16496
diff changeset
     6
  [255]
5d0538599428 test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16496
diff changeset
     7
#else
11859
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
     8
  $ hg clone http://localhost:$HGPORT/ copy
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
     9
  abort: error: Connection refused
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11859
diff changeset
    10
  [255]
17019
5d0538599428 test-bad-pull: partially adjust for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16496
diff changeset
    11
#endif
395
fbe8834923c5 commands: report http exceptions nicely
mpm@selenic.com
parents:
diff changeset
    12
15515
21766d5531cb tests: remove hacks for testing if file or directory exists
Mads Kiilerich <mads@kiilerich.com>
parents: 15446
diff changeset
    13
  $ test -d copy
21766d5531cb tests: remove hacks for testing if file or directory exists
Mads Kiilerich <mads@kiilerich.com>
parents: 15446
diff changeset
    14
  [1]
395
fbe8834923c5 commands: report http exceptions nicely
mpm@selenic.com
parents:
diff changeset
    15
11859
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    16
  $ cat > dumb.py <<EOF
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    17
  > import BaseHTTPServer, SimpleHTTPServer, os, signal
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    18
  > def run(server_class=BaseHTTPServer.HTTPServer,
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    19
  >         handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    20
  >     server_address = ('localhost', int(os.environ['HGPORT']))
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    21
  >     httpd = server_class(server_address, handler_class)
16334
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    22
  >     open("listening", "w")
16296
4343d5226149 tests: eliminate daemon race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 15515
diff changeset
    23
  >     httpd.handle_request()
11859
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    24
  > run()
f48178034569 tests: unify test-bad-pull
Martin Geisler <mg@lazybytes.net>
parents: 10154
diff changeset
    25
  > EOF
395
fbe8834923c5 commands: report http exceptions nicely
mpm@selenic.com
parents:
diff changeset
    26
16334
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    27
  $ python dumb.py 2> log &
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    28
  $ P=$!
16496
abbabbbe4ec2 tests: use 'do sleep 0' instead of 'do true', also on first line of command
Mads Kiilerich <mads@kiilerich.com>
parents: 16341
diff changeset
    29
  $ while [ ! -f listening ]; do sleep 0; done
16334
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    30
  $ hg clone http://localhost:$HGPORT/foo copy2
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    31
  abort: HTTP Error 404: * (glob)
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    32
  [255]
b9bd95e61b49 tests: fix shutdown race in test-bad-pull
Matt Mackall <mpm@selenic.com>
parents: 16296
diff changeset
    33
  $ wait $P