tests/test-hardlinks.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Fri, 26 Apr 2024 19:10:35 +0100
changeset 51626 865efc020c33
parent 51492 2e8a88e5809f
permissions -rw-r--r--
dirstate: remove the python-side whitelist of allowed matchers This whitelist is too permissive because it allows matchers that contain disallowed ones deep inside, for example through `intersectionmatcher`. It is also too restrictive because it doesn't pass through some of the matchers we support, such as `patternmatcher`. It's also unnecessary because unsupported matchers raise `FallbackError` and we fall back anyway. Making this change makes more of the tests use rust code path, and therefore subtly change behavior. For example, rust status in largefiles repos seems to have strange behavior.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37338
cbc4425e81b5 tests: conditionalize tests based on presence of revlogs for files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35393
diff changeset
     1
#require hardlink reporevlogstore
16971
8aeb2f1ae94c tests: introduce hghave hardlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 16918
diff changeset
     2
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     3
  $ cat > nlinks.py <<EOF
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
     4
  > import sys
40869
f79659e1e50f py3: convert filename to bytes in test-hardlinks.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 40835
diff changeset
     5
  > from mercurial import pycompat, util
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     6
  > for f in sorted(sys.stdin.readlines()):
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     7
  >     f = f[:-1]
40869
f79659e1e50f py3: convert filename to bytes in test-hardlinks.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 40835
diff changeset
     8
  >     print(util.nlinks(pycompat.fsencode(f)), f)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     9
  > EOF
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    10
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    11
  $ nlinksdir()
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    12
  > {
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39489
diff changeset
    13
  >     find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    14
  > }
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    15
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    16
Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    17
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    18
  $ cat > linkcp.py <<EOF
33958
163b6b7f333c tests: update test-hardlinks to pass our import checker
Augie Fackler <raf@durin42.com>
parents: 33721
diff changeset
    19
  > import sys
40332
e0dea186ab6e py3: fix test-hardlinks.t
Mark Thomas <mbthomas@fb.com>
parents: 39707
diff changeset
    20
  > from mercurial import pycompat, util
e0dea186ab6e py3: fix test-hardlinks.t
Mark Thomas <mbthomas@fb.com>
parents: 39707
diff changeset
    21
  > util.copyfiles(pycompat.fsencode(sys.argv[1]),
e0dea186ab6e py3: fix test-hardlinks.t
Mark Thomas <mbthomas@fb.com>
parents: 39707
diff changeset
    22
  >                pycompat.fsencode(sys.argv[2]), hardlink=True)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    23
  > EOF
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    24
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    25
  $ linkcp()
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    26
  > {
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39489
diff changeset
    27
  >     "$PYTHON" $TESTTMP/linkcp.py $1 $2
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    28
  > }
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    29
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    30
Prepare repo r1:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    31
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13272
diff changeset
    32
  $ hg init r1
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    33
  $ cd r1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    34
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    35
  $ echo c1 > f1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    36
  $ hg add f1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    37
  $ hg ci -m0
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    38
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    39
  $ mkdir d1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    40
  $ cd d1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    41
  $ echo c2 > f2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    42
  $ hg add f2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    43
  $ hg ci -m1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    44
  $ cd ../..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    45
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    46
  $ nlinksdir r1/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    47
  1 r1/.hg/store/00changelog-b870a51b.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    48
  1 r1/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    49
  1 r1/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    50
  1 r1/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    51
  1 r1/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    52
  1 r1/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    53
  1 r1/.hg/store/data/f1.i
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
    54
  1 r1/.hg/store/fncache (repofncache !)
15483
9ae766f2f452 phases: set new commit in 1-phase
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15455
diff changeset
    55
  1 r1/.hg/store/phaseroots
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
    56
  1 r1/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    57
  1 r1/.hg/store/undo
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    58
  1 r1/.hg/store/undo.backup.00changelog.n.bck (rust !)
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
    59
  1 r1/.hg/store/undo.backup.fncache.bck (repofncache !)
23904
d251da5e0e84 transaction: include backup file in the "undo" transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23786
diff changeset
    60
  1 r1/.hg/store/undo.backupfiles
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    61
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    62
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    63
Create hardlinked clone r2:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    64
25125
bd625cd4e5e7 progress: get the extremely verbose output out of default debug
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24440
diff changeset
    65
  $ hg clone -U --debug r1 r2 --config progress.debug=true
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    66
  linking: 1/8 files (12.50%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    67
  linking: 2/8 files (25.00%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    68
  linking: 3/8 files (37.50%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    69
  linking: 4/8 files (50.00%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    70
  linking: 5/8 files (62.50%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    71
  linking: 6/8 files (75.00%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    72
  linking: 7/8 files (87.50%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    73
  linking: 8/8 files (100.00%) (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    74
  linked 8 files (no-rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    75
  linking: 1/10 files (10.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    76
  linking: 2/10 files (20.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    77
  linking: 3/10 files (30.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    78
  linking: 4/10 files (40.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    79
  linking: 5/10 files (50.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    80
  linking: 6/10 files (60.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    81
  linking: 7/10 files (70.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    82
  linking: 8/10 files (80.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    83
  linking: 9/10 files (90.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    84
  linking: 10/10 files (100.00%) (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
    85
  linked 10 files (rust !)
46314
95a615dd77bf clone: make sure we warm the cache after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41965
diff changeset
    86
  updating the branch cache
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    87
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    88
Create non-hardlinked clone r3:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    89
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    90
  $ hg clone --pull r1 r3
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    91
  requesting all changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    92
  adding changesets
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    93
  adding manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    94
  adding file changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    95
  added 2 changesets with 2 changes to 2 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33958
diff changeset
    96
  new changesets 40d85e9847f2:7069c422939c
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    97
  updating to branch default
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    98
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    99
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   100
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   101
Repos r1 and r2 should now contain hardlinked files:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   102
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   103
  $ nlinksdir r1/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   104
  1 r1/.hg/store/00changelog-b870a51b.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   105
  2 r1/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   106
  2 r1/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   107
  1 r1/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   108
  2 r1/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   109
  2 r1/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   110
  2 r1/.hg/store/data/f1.i
47447
377d8fc20e34 clone: reuse the stream clone logic for local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47183
diff changeset
   111
  1 r1/.hg/store/fncache (repofncache !)
15483
9ae766f2f452 phases: set new commit in 1-phase
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15455
diff changeset
   112
  1 r1/.hg/store/phaseroots
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   113
  1 r1/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   114
  1 r1/.hg/store/undo
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   115
  1 r1/.hg/store/undo.backup.00changelog.n.bck (rust !)
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   116
  1 r1/.hg/store/undo.backup.fncache.bck (repofncache !)
23904
d251da5e0e84 transaction: include backup file in the "undo" transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23786
diff changeset
   117
  1 r1/.hg/store/undo.backupfiles
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   118
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   119
  $ nlinksdir r2/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   120
  1 r2/.hg/store/00changelog-b870a51b.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   121
  2 r2/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   122
  2 r2/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   123
  1 r2/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   124
  2 r2/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   125
  2 r2/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   126
  2 r2/.hg/store/data/f1.i
47447
377d8fc20e34 clone: reuse the stream clone logic for local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47183
diff changeset
   127
  1 r2/.hg/store/fncache (repofncache !)
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   128
  1 r2/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   129
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   130
Repo r3 should not be hardlinked:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   131
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   132
  $ nlinksdir r3/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   133
  1 r3/.hg/store/00changelog-88698448.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   134
  1 r3/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   135
  1 r3/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   136
  1 r3/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   137
  1 r3/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   138
  1 r3/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   139
  1 r3/.hg/store/data/f1.i
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
   140
  1 r3/.hg/store/fncache (repofncache !)
15659
7fba5a245acc phases: change publish behavior to only alter behavior when server.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15483
diff changeset
   141
  1 r3/.hg/store/phaseroots
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   142
  1 r3/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   143
  1 r3/.hg/store/undo
23904
d251da5e0e84 transaction: include backup file in the "undo" transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23786
diff changeset
   144
  1 r3/.hg/store/undo.backupfiles
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   145
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   146
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   147
Create a non-inlined filelog in r3:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   148
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   149
  $ cd r3/d1
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   150
  >>> f = open('data1', 'wb')
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   151
  >>> for x in range(10000):
38086
b95a6fb7ae66 py3: fix .write() calls in few tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 37415
diff changeset
   152
  ...     f.write(b"%d\n" % x) and None
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   153
  >>> f.close()
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   154
  $ for j in 0 1 2 3 4 5 6 7 8 9; do
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   155
  >   cat data1 >> f2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   156
  >   hg commit -m$j
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   157
  > done
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   158
  $ cd ../..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   159
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   160
  $ nlinksdir r3/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   161
  1 r3/.hg/store/00changelog-ea337809.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   162
  1 r3/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   163
  1 r3/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   164
  1 r3/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   165
  1 r3/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   166
  1 r3/.hg/store/data/d1/f2.d
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   167
  1 r3/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   168
  1 r3/.hg/store/data/f1.i
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
   169
  1 r3/.hg/store/fncache (repofncache !)
15483
9ae766f2f452 phases: set new commit in 1-phase
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15455
diff changeset
   170
  1 r3/.hg/store/phaseroots
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   171
  1 r3/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   172
  1 r3/.hg/store/undo
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   173
  1 r3/.hg/store/undo.backup.00changelog.n.bck (rust !)
23904
d251da5e0e84 transaction: include backup file in the "undo" transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23786
diff changeset
   174
  1 r3/.hg/store/undo.backupfiles
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   175
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   176
Push to repo r1 should break up most hardlinks in r2:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   177
49825
2f2682f40ea0 tests: use the `--quiet` flag for verify when applicable
Raphaël Gomès <rgomes@octobus.net>
parents: 48876
diff changeset
   178
  $ hg -R r2 verify -q
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   179
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   180
  $ cd r3
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   181
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
   182
  pushing to $TESTTMP/r1
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   183
  searching for changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   184
  adding changesets
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   185
  adding manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   186
  adding file changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   187
  added 10 changesets with 10 changes to 1 files
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   188
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   189
  $ cd ..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   190
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   191
  $ nlinksdir r2/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   192
  1 r2/.hg/store/00changelog-b870a51b.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   193
  1 r2/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   194
  1 r2/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   195
  1 r2/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   196
  1 r2/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   197
  1 r2/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   198
  2 r2/.hg/store/data/f1.i
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
   199
  [12] r2/\.hg/store/fncache (re) (repofncache !)
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   200
  1 r2/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   201
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
   202
#if hardlink-whitelisted repofncache
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   203
  $ nlinksdir r2/.hg/store/fncache
47447
377d8fc20e34 clone: reuse the stream clone logic for local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47183
diff changeset
   204
  1 r2/.hg/store/fncache
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   205
#endif
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   206
49825
2f2682f40ea0 tests: use the `--quiet` flag for verify when applicable
Raphaël Gomès <rgomes@octobus.net>
parents: 48876
diff changeset
   207
  $ hg -R r2 verify -q
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   208
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   209
  $ cd r1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   210
  $ hg up
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   211
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   212
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   213
Committing a change to f1 in r1 must break up hardlink f1.i in r2:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   214
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   215
  $ echo c1c1 >> f1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   216
  $ hg ci -m00
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   217
  $ cd ..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   218
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   219
  $ nlinksdir r2/.hg/store
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   220
  1 r2/.hg/store/00changelog-b870a51b.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   221
  1 r2/.hg/store/00changelog.d
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   222
  1 r2/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   223
  1 r2/.hg/store/00changelog.n (rust !)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   224
  1 r2/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   225
  1 r2/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   226
  1 r2/.hg/store/data/f1.i
47447
377d8fc20e34 clone: reuse the stream clone logic for local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47183
diff changeset
   227
  1 r2/.hg/store/fncache (repofncache !)
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   228
  1 r2/.hg/store/requires
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   229
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
   230
#if hardlink-whitelisted repofncache
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   231
  $ nlinksdir r2/.hg/store/fncache
47447
377d8fc20e34 clone: reuse the stream clone logic for local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47183
diff changeset
   232
  1 r2/.hg/store/fncache
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   233
#endif
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   234
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   235
Create a file which exec permissions we will change
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   236
  $ cd r3
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   237
  $ echo "echo hello world" > f3
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   238
  $ hg add f3
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   239
  $ hg ci -mf3
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   240
  $ cd ..
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   241
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   242
  $ cd r3
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   243
  $ hg tip --template '{rev}:{node|short}\n'
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   244
  12:d3b77733a28a
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   245
  $ echo bla > f1
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   246
  $ chmod +x f3
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   247
  $ hg ci -m1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   248
  $ cd ..
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   249
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   250
Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   251
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   252
  $ linkcp r3 r4
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   253
32295
b9135f191d8a test-hardlink: do not test .hg/cache/checklink
Jun Wu <quark@fb.com>
parents: 32294
diff changeset
   254
'checklink' is produced by hardlinking a symlink, which is undefined whether
b9135f191d8a test-hardlink: do not test .hg/cache/checklink
Jun Wu <quark@fb.com>
parents: 32294
diff changeset
   255
the symlink should be followed or not. It does behave differently on Linux and
b9135f191d8a test-hardlink: do not test .hg/cache/checklink
Jun Wu <quark@fb.com>
parents: 32294
diff changeset
   256
BSD. Just remove it so the test pass on both platforms.
b9135f191d8a test-hardlink: do not test .hg/cache/checklink
Jun Wu <quark@fb.com>
parents: 32294
diff changeset
   257
40835
a444b7eb4633 tests: update `rm` invocation for new location of checklink
Augie Fackler <augie@google.com>
parents: 40807
diff changeset
   258
  $ rm -f r4/.hg/wcache/checklink
32295
b9135f191d8a test-hardlink: do not test .hg/cache/checklink
Jun Wu <quark@fb.com>
parents: 32294
diff changeset
   259
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   260
r4 has hardlinks in the working dir (not just inside .hg):
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   261
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   262
  $ nlinksdir r4
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   263
  2 r4/.hg/00changelog.i
50195
11e6eee4b063 transaction: use the standard transaction mechanism to backup branch
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50194
diff changeset
   264
  [24] r4/.hg/branch (re)
32304
37bcb4665529 tests: fix up recent conditionalized output changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 32295
diff changeset
   265
  2 r4/.hg/cache/branch2-base
37bcb4665529 tests: fix up recent conditionalized output changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 32295
diff changeset
   266
  2 r4/.hg/cache/branch2-served
23786
7d63398fbfd1 branchmap: use revbranchcache when updating branch map
Mads Kiilerich <madski@unity3d.com>
parents: 22648
diff changeset
   267
  2 r4/.hg/cache/rbc-names-v1
7d63398fbfd1 branchmap: use revbranchcache when updating branch map
Mads Kiilerich <madski@unity3d.com>
parents: 22648
diff changeset
   268
  2 r4/.hg/cache/rbc-revs-v1
46314
95a615dd77bf clone: make sure we warm the cache after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41965
diff changeset
   269
  2 r4/.hg/cache/tags2
95a615dd77bf clone: make sure we warm the cache after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41965
diff changeset
   270
  2 r4/.hg/cache/tags2-served
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   271
  2 r4/.hg/dirstate
33427
1bdafe1111ce tests: add extra output for fsmonitor at checking under .hg
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   272
  2 r4/.hg/fsmonitor.state (fsmonitor !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   273
  2 r4/.hg/hgrc
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   274
  2 r4/.hg/last-message.txt
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   275
  2 r4/.hg/requires
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   276
  2 r4/.hg/store/00changelog-7f2eb713.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   277
  2 r4/.hg/store/00changelog.d
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   278
  2 r4/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   279
  2 r4/.hg/store/00changelog.n (rust !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   280
  2 r4/.hg/store/00manifest.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   281
  2 r4/.hg/store/data/d1/f2.d
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   282
  2 r4/.hg/store/data/d1/f2.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   283
  2 r4/.hg/store/data/f1.i
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   284
  2 r4/.hg/store/data/f3.i
37415
c2c8962a9465 simplestore: use a custom store for the simple store repo
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37338
diff changeset
   285
  2 r4/.hg/store/fncache (repofncache !)
15483
9ae766f2f452 phases: set new commit in 1-phase
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15455
diff changeset
   286
  2 r4/.hg/store/phaseroots
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   287
  2 r4/.hg/store/requires
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   288
  2 r4/.hg/store/undo
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   289
  2 r4/.hg/store/undo.backup.00changelog.n.bck (rust !)
23904
d251da5e0e84 transaction: include backup file in the "undo" transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23786
diff changeset
   290
  2 r4/.hg/store/undo.backupfiles
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   291
  [24] r4/.hg/undo.backup.branch.bck (re)
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   292
  2 r4/\.hg/undo\.backup\.dirstate.bck (re)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   293
  2 r4/.hg/undo.desc
40807
f6d37e84d8f9 tests: stabilize for recent wcache changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 40792
diff changeset
   294
  2 r4/.hg/wcache/checkisexec (execbit !)
f6d37e84d8f9 tests: stabilize for recent wcache changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 40792
diff changeset
   295
  2 r4/.hg/wcache/checklink-target (symlink !)
f6d37e84d8f9 tests: stabilize for recent wcache changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 40792
diff changeset
   296
  2 r4/.hg/wcache/checknoexec (execbit !)
41965
e4ac7e63c213 manifestcache: use `wcache` directory for manifest cache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41964
diff changeset
   297
  2 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   298
  2 r4/d1/data1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   299
  2 r4/d1/f2
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   300
  2 r4/f1
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   301
  2 r4/f3
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   302
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   303
Update back to revision 12 in r4 should break hardlink of file f1 and f3:
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   304
#if hardlink-whitelisted
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   305
  $ nlinksdir r4/.hg/undo.backup.dirstate.bck r4/.hg/dirstate
50083
a28cedb26139 test-hardlink: stop explicitly listing `undo.dirstate`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49825
diff changeset
   306
  2 r4/.hg/dirstate
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   307
  2 r4/.hg/undo.backup.dirstate.bck
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   308
#endif
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   309
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   310
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   311
  $ hg -R r4 up 12
32780
5e76a07e9f42 test-hardlinks: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32721
diff changeset
   312
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
5e76a07e9f42 test-hardlinks: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32721
diff changeset
   313
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   314
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   315
  $ nlinksdir r4
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   316
  2 r4/.hg/00changelog.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   317
  1 r4/.hg/branch
32304
37bcb4665529 tests: fix up recent conditionalized output changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 32295
diff changeset
   318
  2 r4/.hg/cache/branch2-base
37bcb4665529 tests: fix up recent conditionalized output changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 32295
diff changeset
   319
  2 r4/.hg/cache/branch2-served
23786
7d63398fbfd1 branchmap: use revbranchcache when updating branch map
Mads Kiilerich <madski@unity3d.com>
parents: 22648
diff changeset
   320
  2 r4/.hg/cache/rbc-names-v1
7d63398fbfd1 branchmap: use revbranchcache when updating branch map
Mads Kiilerich <madski@unity3d.com>
parents: 22648
diff changeset
   321
  2 r4/.hg/cache/rbc-revs-v1
46314
95a615dd77bf clone: make sure we warm the cache after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41965
diff changeset
   322
  2 r4/.hg/cache/tags2
95a615dd77bf clone: make sure we warm the cache after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41965
diff changeset
   323
  2 r4/.hg/cache/tags2-served
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   324
  1 r4/.hg/dirstate
33427
1bdafe1111ce tests: add extra output for fsmonitor at checking under .hg
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32940
diff changeset
   325
  1 r4/.hg/fsmonitor.state (fsmonitor !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   326
  2 r4/.hg/hgrc
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   327
  2 r4/.hg/last-message.txt
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   328
  2 r4/.hg/requires
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   329
  2 r4/.hg/store/00changelog-7f2eb713.nd (rust !)
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   330
  2 r4/.hg/store/00changelog.d
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   331
  2 r4/.hg/store/00changelog.i
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   332
  2 r4/.hg/store/00changelog.n (rust !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   333
  2 r4/.hg/store/00manifest.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   334
  2 r4/.hg/store/data/d1/f2.d
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   335
  2 r4/.hg/store/data/d1/f2.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   336
  2 r4/.hg/store/data/f1.i
32721
c2cb0de25120 chmod: create a new file when flags are set on a hardlinked file
Koen Van Hoof <koen.van_hoof@nokia.com>
parents: 32304
diff changeset
   337
  2 r4/.hg/store/data/f3.i
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   338
  2 r4/.hg/store/fncache
15483
9ae766f2f452 phases: set new commit in 1-phase
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15455
diff changeset
   339
  2 r4/.hg/store/phaseroots
48669
7ee07e1a25c0 share-safe: enable by default (BC)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47447
diff changeset
   340
  2 r4/.hg/store/requires
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   341
  2 r4/.hg/store/undo
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50465
diff changeset
   342
  2 r4/.hg/store/undo.backup.00changelog.n.bck (rust !)
23904
d251da5e0e84 transaction: include backup file in the "undo" transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23786
diff changeset
   343
  2 r4/.hg/store/undo.backupfiles
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   344
  [23] r4/.hg/undo.backup.branch.bck (re)
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   345
  2 r4/\.hg/undo\.backup\.dirstate.bck (re)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   346
  2 r4/.hg/undo.desc
40807
f6d37e84d8f9 tests: stabilize for recent wcache changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 40792
diff changeset
   347
  2 r4/.hg/wcache/checkisexec (execbit !)
f6d37e84d8f9 tests: stabilize for recent wcache changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 40792
diff changeset
   348
  2 r4/.hg/wcache/checklink-target (symlink !)
f6d37e84d8f9 tests: stabilize for recent wcache changes
Matt Harbison <matt_harbison@yahoo.com>
parents: 40792
diff changeset
   349
  2 r4/.hg/wcache/checknoexec (execbit !)
41965
e4ac7e63c213 manifestcache: use `wcache` directory for manifest cache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 41964
diff changeset
   350
  1 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   351
  2 r4/d1/data1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   352
  2 r4/d1/f2
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   353
  1 r4/f1
32780
5e76a07e9f42 test-hardlinks: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32721
diff changeset
   354
  1 r4/f3 (execbit !)
5e76a07e9f42 test-hardlinks: stabilize for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32721
diff changeset
   355
  2 r4/f3 (no-execbit !)
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   356
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   357
#if hardlink-whitelisted
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   358
  $ nlinksdir r4/.hg/undo.backup.dirstate.bck r4/.hg/dirstate
50083
a28cedb26139 test-hardlink: stop explicitly listing `undo.dirstate`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49825
diff changeset
   359
  1 r4/.hg/dirstate
50465
63dc24be635d transaction: use a ".bck" extension for all backup file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50303
diff changeset
   360
  2 r4/.hg/undo.backup.dirstate.bck
32294
905a2eff08a6 test-hardlinks: unify two test files into one
Jun Wu <quark@fb.com>
parents: 32268
diff changeset
   361
#endif
13034
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   362
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   363
Test hardlinking outside hg:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   364
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   365
  $ mkdir x
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   366
  $ echo foo > x/a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   367
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   368
  $ linkcp x y
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   369
  $ echo bar >> y/a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   370
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   371
No diff if hardlink:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   372
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   373
  $ diff x/a y/a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   374
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   375
Test mq hardlinking:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   376
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   377
  $ echo "[extensions]" >> $HGRCPATH
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   378
  $ echo "mq=" >> $HGRCPATH
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   379
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   380
  $ hg init a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   381
  $ cd a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   382
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   383
  $ hg qimport -n foo - << EOF
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   384
  > # HG changeset patch
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   385
  > # Date 1 0
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   386
  > diff -r 2588a8b53d66 a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   387
  > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   388
  > +++ b/a	Wed Jul 23 15:54:29 2008 +0200
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   389
  > @@ -0,0 +1,1 @@
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   390
  > +a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   391
  > EOF
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   392
  adding foo to series file
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   393
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   394
  $ hg qpush
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   395
  applying foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   396
  now at: foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   397
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   398
  $ cd ..
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   399
  $ linkcp a b
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   400
  $ cd b
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   401
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   402
  $ hg qimport -n bar - << EOF
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   403
  > # HG changeset patch
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   404
  > # Date 2 0
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   405
  > diff -r 2588a8b53d66 a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   406
  > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   407
  > +++ b/b	Wed Jul 23 15:54:29 2008 +0200
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   408
  > @@ -0,0 +1,1 @@
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   409
  > +b
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   410
  > EOF
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   411
  adding bar to series file
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   412
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   413
  $ hg qpush
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   414
  applying bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   415
  now at: bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   416
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   417
  $ cat .hg/patches/status
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   418
  430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   419
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   420
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   421
  $ cat .hg/patches/series
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   422
  foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   423
  bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   424
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   425
  $ cat ../a/.hg/patches/status
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   426
  430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   427
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   428
  $ cat ../a/.hg/patches/series
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   429
  foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   430
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   431
Test tags hardlinking:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   432
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   433
  $ hg qdel -r qbase:qtip
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   434
  patch foo finalized without changeset message
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   435
  patch bar finalized without changeset message
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   436
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   437
  $ hg tag -l lfoo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   438
  $ hg tag foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   439
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   440
  $ cd ..
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   441
  $ linkcp b c
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   442
  $ cd c
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   443
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   444
  $ hg tag -l -r 0 lbar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   445
  $ hg tag -r 0 bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   446
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   447
  $ cat .hgtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   448
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   449
  430ed4828a74fa4047bc816a25500f7472ab4bfe bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   450
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   451
  $ cat .hg/localtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   452
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   453
  430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   454
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   455
  $ cat ../b/.hgtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   456
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   457
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   458
  $ cat ../b/.hg/localtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   459
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   460
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15659
diff changeset
   461
  $ cd ..