tests/test-pull-bundle.t
author Manuel Jacob <me@manueljacob.de>
Wed, 10 Jun 2020 13:02:39 +0200
changeset 44991 f9734b2d59cc
parent 44765 3d5fb6cab832
child 45730 fbde66b05da4
permissions -rw-r--r--
py3: make stdout line-buffered if connected to a TTY Status messages that are to be shown on the terminal should be written to the file descriptor before anything further is done, to keep the user updated. One common way to achieve this is to make stdout line-buffered if it is connected to a TTY. This is done on Python 2 (except on Windows, where libc, which the CPython 2 streams depend on, does not properly support this). Python 3 rolls it own I/O streams. On Python 3, buffered binary streams can't be set line-buffered. The previous code (added in 227ba1afcb65) incorrectly assumed that on Python 3, pycompat.stdout (sys.stdout.buffer) is already line-buffered. However the interpreter initializes it with a block-buffered stream or an unbuffered stream (when the -u option or the PYTHONUNBUFFERED environment variable is set), never with a line-buffered stream. One example where the current behavior is unacceptable is when running `hg pull https://www.mercurial-scm.org/repo/hg` on Python 3, where the line "pulling from https://www.mercurial-scm.org/repo/hg" does not appear on the terminal before the hg process blocks while waiting for the server. Various approaches to fix this problem are possible, including: 1. Weaken the contract of procutil.stdout to not give any guarantees about buffering behavior. In this case, users of procutil.stdout need to be changed to do enough flushes. In particular, 1. either ui must insert enough flushes for ui.write() and friends, or 2. ui.write() and friends get split into flushing and fully buffered methods, or 3. users of ui.write() and friends must flush explicitly. 2. Make stdout unbuffered. 3. Make stdout line-buffered. Since Python 3 does not natively support that for binary streams, we must implement it ourselves. (2.) is problematic because using unbuffered I/O changes the performance characteristics significantly compared to line-buffered (which is used on Python 2) and this would be a regression. (1.2.) and (1.3) are a substantial amount of work. It’s unclear whether the added complexity would be justified, given that raw performance doesn’t matter that much when writing to a terminal much faster than the user could read it. (1.1.) pushes complexity into the ui class instead of separating the concern of how stdout is buffered. Other users of procutil.stdout would still need to take care of the flushes. This patch implements (3.). The general performance considerations are very similar to (1.1.). The extra method invocation and method forwarding add a little more overhead if the class is used. In exchange, it doesn’t add overhead if not used. For the benchmarks, I compared the previous implementation (incorrect on Python 3), (1.1.), (3.) and (2.). The command was chosen so that the streams were configured as if they were writing to a TTY, but actually write to a pager, which is also the default: HGRCPATH=/dev/null python3 ./hg --cwd ~/vcs/mozilla-central --time --pager yes --config pager.pager='cat > /dev/null' status --all previous: time: real 7.880 secs (user 7.290+0.050 sys 0.580+0.170) time: real 7.830 secs (user 7.220+0.070 sys 0.590+0.140) time: real 7.800 secs (user 7.210+0.050 sys 0.570+0.170) (1.1.) using Yuya Nishihara’s patch: time: real 9.860 secs (user 8.670+0.350 sys 1.160+0.830) time: real 9.540 secs (user 8.430+0.370 sys 1.100+0.770) time: real 9.830 secs (user 8.630+0.370 sys 1.180+0.840) (3.) using this patch: time: real 9.580 secs (user 8.480+0.350 sys 1.090+0.770) time: real 9.670 secs (user 8.480+0.330 sys 1.170+0.860) time: real 9.640 secs (user 8.500+0.350 sys 1.130+0.810) (2.) using a previous patch by me: time: real 10.480 secs (user 8.850+0.720 sys 1.590+1.500) time: real 10.490 secs (user 8.750+0.750 sys 1.710+1.470) time: real 10.240 secs (user 8.600+0.700 sys 1.590+1.510) As expected, there’s no difference on Python 2, as exactly the same code paths are used: previous: time: real 6.950 secs (user 5.870+0.330 sys 1.070+0.770) time: real 7.040 secs (user 6.040+0.360 sys 0.980+0.750) time: real 7.070 secs (user 5.950+0.360 sys 1.100+0.760) this patch: time: real 7.010 secs (user 5.900+0.390 sys 1.070+0.730) time: real 7.000 secs (user 5.850+0.350 sys 1.120+0.760) time: real 7.000 secs (user 5.790+0.380 sys 1.170+0.710)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38063
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37592
diff changeset
     1
#require no-chg
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37592
diff changeset
     2
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     3
  $ hg init repo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     4
  $ cd repo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     5
  $ echo foo > foo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     6
  $ hg ci -qAm 'add foo'
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     7
  $ echo >> foo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     8
  $ hg ci -m 'change foo'
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
     9
  $ hg up -qC 0
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    10
  $ echo bar > bar
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    11
  $ hg ci -qAm 'add bar'
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    12
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    13
  $ hg log
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    14
  changeset:   2:effea6de0384
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    15
  tag:         tip
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    16
  parent:      0:bbd179dfa0a7
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    17
  user:        test
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    18
  date:        Thu Jan 01 00:00:00 1970 +0000
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    19
  summary:     add bar
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    20
  
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    21
  changeset:   1:ed1b79f46b9a
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    22
  user:        test
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    23
  date:        Thu Jan 01 00:00:00 1970 +0000
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    24
  summary:     change foo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    25
  
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    26
  changeset:   0:bbd179dfa0a7
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    27
  user:        test
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    28
  date:        Thu Jan 01 00:00:00 1970 +0000
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    29
  summary:     add foo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    30
  
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    31
  $ cd ..
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    32
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    33
Test pullbundle functionality
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    34
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    35
  $ cd repo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    36
  $ cat <<EOF > .hg/hgrc
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    37
  > [server]
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    38
  > pullbundle = True
44765
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
    39
  > [experimental]
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
    40
  > evolution = True
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    41
  > [extensions]
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    42
  > blackbox =
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    43
  > EOF
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    44
  $ hg bundle --base null -r 0 .hg/0.hg
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    45
  1 changesets found
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    46
  $ hg bundle --base 0 -r 1 .hg/1.hg
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    47
  1 changesets found
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    48
  $ hg bundle --base 1 -r 2 .hg/2.hg
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    49
  1 changesets found
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    50
  $ cat <<EOF > .hg/pullbundles.manifest
38678
7e4a856a4f05 pullbundle: fix handling of gzip bundlespecs
Joerg Sonnenberger <joerg@bec.de>
parents: 38063
diff changeset
    51
  > 2.hg BUNDLESPEC=none-v2 heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
7e4a856a4f05 pullbundle: fix handling of gzip bundlespecs
Joerg Sonnenberger <joerg@bec.de>
parents: 38063
diff changeset
    52
  > 1.hg BUNDLESPEC=bzip2-v2 heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
7e4a856a4f05 pullbundle: fix handling of gzip bundlespecs
Joerg Sonnenberger <joerg@bec.de>
parents: 38063
diff changeset
    53
  > 0.hg BUNDLESPEC=gzip-v2 heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    54
  > EOF
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    55
  $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
37592
fb91757471b5 tests: glob away fqdn wherever we print it
Augie Fackler <augie@google.com>
parents: 37516
diff changeset
    56
  listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    57
  $ cat ../repo.pid >> $DAEMON_PIDS
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    58
  $ cd ..
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    59
  $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    60
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    61
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    62
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    63
  added 1 changesets with 1 changes to 1 files
39497
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 38678
diff changeset
    64
  new changesets bbd179dfa0a7 (1 drafts)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    65
  updating to branch default
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    66
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    67
  $ cd repo.pullbundle
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    68
  $ hg pull -r 1
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    69
  pulling from http://localhost:$HGPORT2/
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    70
  searching for changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    71
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    72
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    73
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    74
  added 1 changesets with 1 changes to 1 files
39497
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 38678
diff changeset
    75
  new changesets ed1b79f46b9a (1 drafts)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    76
  (run 'hg update' to get a working copy)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    77
  $ hg pull -r 2
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    78
  pulling from http://localhost:$HGPORT2/
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    79
  searching for changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    80
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    81
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    82
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    83
  added 1 changesets with 1 changes to 1 files (+1 heads)
39497
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 38678
diff changeset
    84
  new changesets effea6de0384 (1 drafts)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    85
  (run 'hg heads' to see heads, 'hg merge' to merge)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    86
  $ cd ..
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    87
  $ killdaemons.py
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    88
  $ grep 'sending pullbundle ' repo/.hg/blackbox.log
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    89
  * sending pullbundle "0.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    90
  * sending pullbundle "1.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    91
  * sending pullbundle "2.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    92
  $ rm repo/.hg/blackbox.log
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    93
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    94
Test pullbundle functionality for incremental pulls
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    95
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    96
  $ cd repo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    97
  $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
37592
fb91757471b5 tests: glob away fqdn wherever we print it
Augie Fackler <augie@google.com>
parents: 37516
diff changeset
    98
  listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
    99
  $ cat ../repo.pid >> $DAEMON_PIDS
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   100
  $ cd ..
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   101
  $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   102
  requesting all changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   103
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   104
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   105
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   106
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   107
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   108
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   109
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   110
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   111
  adding file changes
42903
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42143
diff changeset
   112
  added 3 changesets with 3 changes to 3 files (+1 heads)
39497
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 38678
diff changeset
   113
  new changesets bbd179dfa0a7:ed1b79f46b9a (3 drafts)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   114
  updating to branch default
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   115
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   116
  $ killdaemons.py
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   117
  $ grep 'sending pullbundle ' repo/.hg/blackbox.log
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   118
  * sending pullbundle "0.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   119
  * sending pullbundle "2.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   120
  * sending pullbundle "1.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   121
  $ rm repo/.hg/blackbox.log
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   122
42143
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   123
Test pullbundle functionality for incoming
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   124
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   125
  $ cd repo
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   126
  $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   127
  listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?)
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   128
  $ cat ../repo.pid >> $DAEMON_PIDS
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   129
  $ cd ..
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   130
  $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2a -r 0
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   131
  adding changesets
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   132
  adding manifests
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   133
  adding file changes
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   134
  added 1 changesets with 1 changes to 1 files
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   135
  new changesets bbd179dfa0a7 (1 drafts)
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   136
  updating to branch default
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   137
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   138
  $ cd repo.pullbundle2a
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   139
  $ hg incoming -r ed1b79f46b9a
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   140
  comparing with http://localhost:$HGPORT2/
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   141
  searching for changes
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   142
  changeset:   1:ed1b79f46b9a
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   143
  tag:         tip
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   144
  user:        test
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   145
  date:        Thu Jan 01 00:00:00 1970 +0000
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   146
  summary:     change foo
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   147
  
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   148
  $ cd ..
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   149
  $ killdaemons.py
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   150
  $ grep 'sending pullbundle ' repo/.hg/blackbox.log
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   151
  * sending pullbundle "0.hg" (glob)
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   152
  * sending pullbundle "1.hg" (glob)
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   153
  $ rm repo/.hg/blackbox.log
29569f2db929 bundle2: handle compression in _forwardchunks
Joerg Sonnenberger <joerg@bec.de>
parents: 39497
diff changeset
   154
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   155
Test recovery from misconfigured server sending no new data
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   156
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   157
  $ cd repo
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   158
  $ cat <<EOF > .hg/pullbundles.manifest
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   159
  > 0.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   160
  > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   161
  > EOF
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   162
  $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
37592
fb91757471b5 tests: glob away fqdn wherever we print it
Augie Fackler <augie@google.com>
parents: 37516
diff changeset
   163
  listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   164
  $ cat ../repo.pid >> $DAEMON_PIDS
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   165
  $ cd ..
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   166
  $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle3
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   167
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   168
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   169
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   170
  added 1 changesets with 1 changes to 1 files
39497
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 38678
diff changeset
   171
  new changesets bbd179dfa0a7 (1 drafts)
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   172
  updating to branch default
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   173
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   174
  $ cd repo.pullbundle3
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   175
  $ hg pull -r 1
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   176
  pulling from http://localhost:$HGPORT2/
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   177
  searching for changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   178
  adding changesets
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   179
  adding manifests
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   180
  adding file changes
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   181
  added 0 changesets with 0 changes to 1 files
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   182
  abort: 00changelog.i@ed1b79f46b9a: no node!
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   183
  [255]
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   184
  $ cd ..
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   185
  $ killdaemons.py
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   186
  $ grep 'sending pullbundle ' repo/.hg/blackbox.log
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   187
  * sending pullbundle "0.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   188
  * sending pullbundle "0.hg" (glob)
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents:
diff changeset
   189
  $ rm repo/.hg/blackbox.log
44765
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   190
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   191
Test processing when nodes used in the pullbundle.manifest end up being hidden
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   192
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   193
  $ hg --repo repo debugobsolete ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   194
  1 new obsolescence markers
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   195
  obsoleted 1 changesets
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   196
  $ hg serve --repo repo --config server.view=visible -p $HGPORT -d --pid-file=hg.pid -E errors.log
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   197
  $ cat hg.pid >> $DAEMON_PIDS
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   198
  $ hg clone http://localhost:$HGPORT repo-obs
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   199
  requesting all changes
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   200
  adding changesets
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   201
  adding manifests
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   202
  adding file changes
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   203
  adding changesets
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   204
  adding manifests
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   205
  adding file changes
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   206
  added 2 changesets with 2 changes to 2 files
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   207
  new changesets bbd179dfa0a7:effea6de0384
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   208
  updating to branch default
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   209
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
3d5fb6cab832 pullbundles: use unfiltered repo for head/base matching
Joerg Sonnenberger <joerg@bec.de>
parents: 42903
diff changeset
   210
  $ killdaemons.py