tests/test-sparse-clone.t
author pacien <pacien.trangirard@pacien.net>
Thu, 17 Mar 2022 11:00:05 +0100
changeset 48969 f64bbba2ee59
parent 47920 9c4204b7f3e4
permissions -rw-r--r--
tests: fix glob pattern for dynamic timer alignment The number of space characters varies depending on the number of digits of the timer, making some tests fail on slow machines in an unintended way: ```diff --- /build/mercurial-6.1/tests/test-merge-halt.t +++ /build/mercurial-6.1/tests/test-merge-halt.t.err @@ -210,6 +210,6 @@ merge halted after failed merge (see hg resolve) [240] $ hg shelve --list - default (* ago) changes to: foo (glob) + default (11s ago) changes to: foo $ hg unshelve --abort unshelve of 'default' aborted ERROR: test-merge-halt.t output changed ``` Differential Revision: https://phab.mercurial-scm.org/D12381
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
test sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH << EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
  > [ui]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  > username = nobody <no.reply@fb.com>
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  > [extensions]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  > sparse=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
  > purge=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  > strip=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
  > rebase=
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  $ hg init myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  $ cd myrepo
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  $ echo a > index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
  $ echo x > data.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
  $ echo z > readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
  $ cat > webpage.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
  > *.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
  $ cat > backend.sparse <<EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  > [include]
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  > *.py
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
  > EOF
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  $ hg ci -Aqm 'initial'
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
  $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
Verify local clone with a sparse profile works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  $ hg clone --enable-profile webpage.sparse myrepo clone1
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
  updating to branch default
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
  warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
  $ cd clone1
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    36
  $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    37
  .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
  $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
Verify local clone with include works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
  $ hg clone --include *.sparse myrepo clone2
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
  updating to branch default
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
  $ cd clone2
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    47
  $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    48
  .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
Verify local clone with exclude works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
  $ hg clone --exclude data.py myrepo clone3
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
  updating to branch default
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  $ cd clone3
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    59
  $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    60
  .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  backend.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
  readme.txt
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
  webpage.sparse
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
  $ cd ..
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
Verify sparse clone profile over ssh works
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
  $ hg clone -q --enable-profile webpage.sparse ssh://user@dummy/myrepo clone4
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
  warning: sparse profile 'webpage.sparse' not found in rev 000000000000 - ignoring it
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
  $ cd clone4
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    72
  $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 39707
diff changeset
    73
  .hg
33289
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  index.html
abd7dedbaa36 sparse: vendor Facebook-developed extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
  $ cd ..