tests/test-narrow-clone-stream.t
author Boris Feld <boris.feld@octobus.net>
Mon, 12 Nov 2018 01:12:15 +0100
changeset 40917 192291ca909b
parent 40631 a694a7159125
child 40937 a0886a4d6dce
permissions -rw-r--r--
test: enable sparse-revlog for test-narrow-clone-stream.t We are about to enable sparse-revlog globally. To help with reviewing the tests change, we isolate them in individual changesets. Differential Revision: https://phab.mercurial-scm.org/D5326
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40917
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
     1
TRANSITIONAL CONFIG
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
     2
  $ cat << EOF >> $HGRCPATH
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
     3
  > [format]
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
     4
  > sparse-revlog = yes
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
     5
  > EOF
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
     6
40630
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
     7
#testcases tree flat-fncache flat-nofncache
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
     8
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     9
Tests narrow stream clones
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    10
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    11
  $ . "$TESTDIR/narrow-library.sh"
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    12
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    13
#if tree
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    14
  $ cat << EOF >> $HGRCPATH
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    15
  > [experimental]
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    16
  > treemanifest = 1
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    17
  > EOF
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    18
#endif
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    19
40630
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    20
#if flat-nofncache
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    21
  $ cat << EOF >> $HGRCPATH
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    22
  > [format]
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    23
  > usefncache = 0
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    24
  > EOF
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    25
#endif
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    26
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    27
Server setup
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    28
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    29
  $ hg init master
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    30
  $ cd master
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    31
  $ mkdir dir
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    32
  $ mkdir dir/src
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    33
  $ cd dir/src
40629
a4c2788e8f48 test-narrow-clone-stream: include uppercase letter in filename
Yuya Nishihara <yuya@tcha.org>
parents: 40596
diff changeset
    34
  $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    35
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    36
  $ cd ..
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    37
  $ mkdir tests
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    38
  $ cd tests
40629
a4c2788e8f48 test-narrow-clone-stream: include uppercase letter in filename
Yuya Nishihara <yuya@tcha.org>
parents: 40596
diff changeset
    39
  $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    40
  $ cd ../../..
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    41
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    42
Trying to stream clone when the server does not support it
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    43
40629
a4c2788e8f48 test-narrow-clone-stream: include uppercase letter in filename
Yuya Nishihara <yuya@tcha.org>
parents: 40596
diff changeset
    44
  $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    45
  streaming all changes
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    46
  remote: abort: server does not support narrow stream clones
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    47
  abort: pull failed on remote
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    48
  [255]
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    49
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    50
Enable stream clone on the server
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    51
40596
d6ec45b79277 tests: fix config knob in test-narrow-clone-stream.t
Augie Fackler <augie@google.com>
parents: 40544
diff changeset
    52
  $ echo "[experimental]" >> master/.hg/hgrc
d6ec45b79277 tests: fix config knob in test-narrow-clone-stream.t
Augie Fackler <augie@google.com>
parents: 40544
diff changeset
    53
  $ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    54
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    55
Cloning a specific file when stream clone is supported
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    56
40629
a4c2788e8f48 test-narrow-clone-stream: include uppercase letter in filename
Yuya Nishihara <yuya@tcha.org>
parents: 40596
diff changeset
    57
  $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream
40338
af62936c2508 streamclone: new server config and some API changes for narrow stream clones
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    58
  streaming all changes
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    59
  * files to transfer, * KB of data (glob)
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    60
  transferred * KB in * seconds (* */sec) (glob)
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    61
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    62
  $ cd narrow
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    63
  $ ls
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    64
  $ hg tracked
40629
a4c2788e8f48 test-narrow-clone-stream: include uppercase letter in filename
Yuya Nishihara <yuya@tcha.org>
parents: 40596
diff changeset
    65
  I path:dir/src/F10
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    66
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    67
Making sure we have the correct set of requirements
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    68
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    69
  $ cat .hg/requires
40630
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    70
  dotencode (tree flat-fncache !)
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    71
  fncache (tree flat-fncache !)
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    72
  generaldelta
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    73
  narrowhg-experimental
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    74
  revlogv1
40917
192291ca909b test: enable sparse-revlog for test-narrow-clone-stream.t
Boris Feld <boris.feld@octobus.net>
parents: 40631
diff changeset
    75
  sparserevlog
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    76
  store
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    77
  treemanifest (tree !)
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    78
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    79
Making sure store has the required files
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    80
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    81
  $ ls .hg/store/
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    82
  00changelog.i
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    83
  00manifest.i
40630
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    84
  data (tree flat-fncache !)
186921bc8e66 test-narrow-clone-stream: include no usefncache case which is broken
Yuya Nishihara <yuya@tcha.org>
parents: 40629
diff changeset
    85
  fncache (tree flat-fncache !)
40544
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    86
  meta (tree !)
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    87
  narrowspec
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    88
  undo
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    89
  undo.backupfiles
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    90
  undo.phaseroots
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    91
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    92
Checking that repository has all the required data and not broken
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    93
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    94
  $ hg verify
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    95
  checking changesets
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    96
  checking manifests
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    97
  checking directory manifests (tree !)
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    98
  crosschecking files in changesets and manifests
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
    99
  checking files
9aeb9e2d28a7 store: introduce _matchtrackedpath() and use it to filter store files
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 40338
diff changeset
   100
  checked 40 changesets with 1 changes to 1 files