tests/test-narrow-commit.t
author Paul Morelle <paul.morelle@octobus.net>
Mon, 04 Jun 2018 22:23:18 +0200
changeset 38717 aa21a9ad46ea
parent 38275 dbf31732ef64
child 39776 7e99b02768ef
permissions -rw-r--r--
sparse-revlog: new requirement enabled with format.sparse-revlog The meaning of the new 'sparse-revlog' requirement is that the revlogs are allowed to contain wider delta chains with larger holes between the interesting chunks. These sparse delta chains should be read in several chunks to avoid a potential explosion of memory usage. Former version won't know how to read a delta chain in several chunks. They would keep reading them in a single read, and therefore would be subject to the potential memory explosion. Hence this new requirement: only versions having support of sparse-revlog reading should be allowed to read such a revlog. Implementation of this new algorithm and tools to enable or disable the requirement will follow in the next changesets.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36122
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     1
#testcases flat tree
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     2
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
  $ . "$TESTDIR/narrow-library.sh"
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
36122
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     5
#if tree
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     6
  $ cat << EOF >> $HGRCPATH
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     7
  > [experimental]
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     8
  > treemanifest = 1
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
     9
  > EOF
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
    10
#endif
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
    11
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
create full repo
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
  $ hg init master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
  $ cd master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
  $ mkdir inside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    18
  $ echo inside > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
  $ mkdir outside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
  $ echo outside > outside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    21
  $ hg ci -Aqm 'initial'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    23
  $ echo modified > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    24
  $ hg ci -qm 'modify inside'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    25
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    26
  $ echo modified > outside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
  $ hg ci -qm 'modify outside'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    29
  $ cd ..
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
37141
4d63f3bc1e1a lfs: respect narrowmatcher when testing to add 'lfs' requirement (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 36248
diff changeset
    31
(The lfs extension does nothing here, but this test ensures that its hook that
4d63f3bc1e1a lfs: respect narrowmatcher when testing to add 'lfs' requirement (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 36248
diff changeset
    32
determines whether to add the lfs requirement, respects the narrow boundaries.)
4d63f3bc1e1a lfs: respect narrowmatcher when testing to add 'lfs' requirement (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 36248
diff changeset
    33
4d63f3bc1e1a lfs: respect narrowmatcher when testing to add 'lfs' requirement (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 36248
diff changeset
    34
  $ hg --config extensions.lfs= clone --narrow ssh://user@dummy/master narrow \
4d63f3bc1e1a lfs: respect narrowmatcher when testing to add 'lfs' requirement (issue5794)
Matt Harbison <matt_harbison@yahoo.com>
parents: 36248
diff changeset
    35
  >    --include inside
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    36
  requesting all changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    37
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    38
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    39
  adding file changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    40
  added 3 changesets with 2 changes to 1 files
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    41
  new changesets *:* (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    42
  updating to branch default
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    43
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    44
  $ cd narrow
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    45
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    46
  $ hg update -q 0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    47
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    48
Can not modify dirstate outside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    49
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    50
  $ mkdir outside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    51
  $ touch outside/f1
38274
7c3a59e2971b debugwalk: show matcher output only if -v/--verbose
Yuya Nishihara <yuya@tcha.org>
parents: 37141
diff changeset
    52
  $ hg debugwalk -v -I 'relglob:f1'
38275
dbf31732ef64 debugwalk: pretty-print nested matcher
Yuya Nishihara <yuya@tcha.org>
parents: 38274
diff changeset
    53
  * matcher:
dbf31732ef64 debugwalk: pretty-print nested matcher
Yuya Nishihara <yuya@tcha.org>
parents: 38274
diff changeset
    54
  <includematcher includes='(?:(?:|.*/)f1(?:/|$))'>
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    55
  f  inside/f1  inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    56
  $ hg add outside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    57
  abort: cannot track 'outside/f1' - it is outside the narrow clone
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    58
  [255]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    59
  $ touch outside/f3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    60
  $ hg add outside/f3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    61
  abort: cannot track 'outside/f3' - it is outside the narrow clone
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    62
  [255]
36238
deb851914fd7 dirstate: drop explicit files that shouldn't match (BC) (issue4679)
Yuya Nishihara <yuya@tcha.org>
parents: 36122
diff changeset
    63
deb851914fd7 dirstate: drop explicit files that shouldn't match (BC) (issue4679)
Yuya Nishihara <yuya@tcha.org>
parents: 36122
diff changeset
    64
But adding a truly excluded file shouldn't count
deb851914fd7 dirstate: drop explicit files that shouldn't match (BC) (issue4679)
Yuya Nishihara <yuya@tcha.org>
parents: 36122
diff changeset
    65
deb851914fd7 dirstate: drop explicit files that shouldn't match (BC) (issue4679)
Yuya Nishihara <yuya@tcha.org>
parents: 36122
diff changeset
    66
  $ hg add outside/f3 -X outside/f3
deb851914fd7 dirstate: drop explicit files that shouldn't match (BC) (issue4679)
Yuya Nishihara <yuya@tcha.org>
parents: 36122
diff changeset
    67
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    68
  $ rm -r outside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    69
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    70
Can modify dirstate inside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    71
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    72
  $ echo modified > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    73
  $ touch inside/f3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    74
  $ hg add inside/f3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    75
  $ hg status
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    76
  M inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    77
  A inside/f3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    78
  $ hg revert -qC .
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    79
  $ rm inside/f3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    80
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    81
Can commit changes inside. Leaves outside unchanged.
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    82
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    83
  $ hg update -q 'desc("initial")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    84
  $ echo modified2 > inside/f1
36248
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    85
  $ hg manifest --debug
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    86
  4d6a634d5ba06331a60c29ee0db8412490a54fcd 644   inside/f1
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    87
  7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644   outside/f1 (flat !)
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    88
  d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    89
  $ hg commit -m 'modify inside/f1'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    90
  created new head
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    91
  $ hg files -r .
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    92
  inside/f1
36122
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
    93
  outside/f1 (flat !)
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36117
diff changeset
    94
  outside/ (tree !)
36248
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    95
  $ hg manifest --debug
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    96
  3f4197b4a11b9016e77ebc47fe566944885fd11b 644   inside/f1
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    97
  7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644   outside/f1 (flat !)
5c9bdfb32eac manifest: add support for including directories outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36238
diff changeset
    98
  d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
36117
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    99
Some filesystems (notably FAT/exFAT only store timestamps with 2
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   100
seconds of precision, so by sleeping for 3 seconds, we can ensure that
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   101
the timestamps of files stored by dirstate will appear older than the
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   102
dirstate file, and therefore we'll be able to get stable output from
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   103
debugdirstate. If we don't do this, the test can be slightly flaky.
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   104
  $ sleep 3
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   105
  $ hg status
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   106
  $ hg debugdirstate --nodates
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   107
  n 644         10 set                 inside/f1