tests/test-hardlinks.t
author Adrian Buehlmann <adrian@cadifra.com>
Mon, 11 Jun 2012 19:57:25 +0200
changeset 16918 b112e265b78a
parent 16913 f2719b387380
child 16971 8aeb2f1ae94c
permissions -rw-r--r--
test-hardlinks: enable for Windows
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     1
  $ cat > nlinks.py <<EOF
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
     2
  > import sys
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
     3
  > from mercurial import util
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     4
  > for f in sorted(sys.stdin.readlines()):
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     5
  >     f = f[:-1]
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
     6
  >     print util.nlinks(f), f
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     7
  > EOF
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     8
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     9
  $ nlinksdir()
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
  >     find $1 -type f | python $TESTTMP/nlinks.py
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    12
  > }
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    13
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    14
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
    15
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    16
  $ cat > linkcp.py <<EOF
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    17
  > from mercurial import util
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    18
  > import sys
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    19
  > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    20
  > EOF
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    21
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    22
  $ linkcp()
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    23
  > {
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    24
  >     python $TESTTMP/linkcp.py $1 $2
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    25
  > }
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
    26
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    27
Prepare repo r1:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    28
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 13272
diff changeset
    29
  $ hg init r1
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    30
  $ cd r1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    31
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    32
  $ echo c1 > f1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    33
  $ hg add f1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    34
  $ hg ci -m0
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    35
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    36
  $ mkdir d1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    37
  $ cd d1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    38
  $ echo c2 > f2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    39
  $ hg add f2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    40
  $ hg ci -m1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    41
  $ cd ../..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    42
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    43
  $ nlinksdir r1/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    44
  1 r1/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    45
  1 r1/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    46
  1 r1/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    47
  1 r1/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    48
  1 r1/.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
    49
  1 r1/.hg/store/phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    50
  1 r1/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15444
diff changeset
    51
  1 r1/.hg/store/undo.phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    52
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    53
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    54
Create hardlinked clone r2:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    55
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    56
  $ hg clone -U --debug r1 r2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    57
  linked 7 files
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    58
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    59
Create non-hardlinked clone r3:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    60
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    61
  $ hg clone --pull r1 r3
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    62
  requesting all changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    63
  adding changesets
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    64
  adding manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    65
  adding file changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    66
  added 2 changesets with 2 changes to 2 files
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    67
  updating to branch default
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    68
  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
    69
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    70
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    71
Repos r1 and r2 should now contain hardlinked files:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    72
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    73
  $ nlinksdir r1/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    74
  2 r1/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    75
  2 r1/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    76
  2 r1/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    77
  2 r1/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    78
  2 r1/.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
    79
  1 r1/.hg/store/phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    80
  1 r1/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15444
diff changeset
    81
  1 r1/.hg/store/undo.phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    82
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    83
  $ nlinksdir r2/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    84
  2 r2/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    85
  2 r2/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    86
  2 r2/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    87
  2 r2/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    88
  2 r2/.hg/store/fncache
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
Repo r3 should not be hardlinked:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    91
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    92
  $ nlinksdir r3/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    93
  1 r3/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    94
  1 r3/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    95
  1 r3/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    96
  1 r3/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    97
  1 r3/.hg/store/fncache
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
    98
  1 r3/.hg/store/phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    99
  1 r3/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15444
diff changeset
   100
  1 r3/.hg/store/undo.phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   101
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
Create a non-inlined filelog in r3:
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   104
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   105
  $ cd r3/d1
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   106
  >>> f = open('data1', 'wb')
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   107
  >>> for x in range(10000):
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   108
  ...     f.write("%s\n" % str(x))
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   109
  >>> f.close()
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   110
  $ 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
   111
  >   cat data1 >> f2
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   112
  >   hg commit -m$j
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   113
  > done
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   114
  $ cd ../..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   115
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   116
  $ nlinksdir r3/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   117
  1 r3/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   118
  1 r3/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   119
  1 r3/.hg/store/data/d1/f2.d
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   120
  1 r3/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   121
  1 r3/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   122
  1 r3/.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
   123
  1 r3/.hg/store/phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   124
  1 r3/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15444
diff changeset
   125
  1 r3/.hg/store/undo.phaseroots
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   126
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   127
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
   128
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   129
  $ hg -R r2 verify
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   130
  checking changesets
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   131
  checking manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   132
  crosschecking files in changesets and manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   133
  checking files
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   134
  2 files, 2 changesets, 2 total revisions
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   135
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   136
  $ cd r3
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   137
  $ hg push
16918
b112e265b78a test-hardlinks: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16913
diff changeset
   138
  pushing to $TESTTMP/r1 (glob)
12967
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   139
  searching for changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   140
  adding changesets
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   141
  adding manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   142
  adding file changes
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   143
  added 10 changesets with 10 changes to 1 files
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   144
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   145
  $ cd ..
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
  $ nlinksdir r2/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   148
  1 r2/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   149
  1 r2/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   150
  1 r2/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   151
  2 r2/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   152
  1 r2/.hg/store/fncache
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   153
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   154
  $ hg -R r2 verify
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   155
  checking changesets
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   156
  checking manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   157
  crosschecking files in changesets and manifests
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   158
  checking files
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   159
  2 files, 2 changesets, 2 total revisions
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   160
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   161
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   162
  $ cd r1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   163
  $ hg up
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   164
  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
   165
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   166
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
   167
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   168
  $ echo c1c1 >> f1
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   169
  $ hg ci -m00
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   170
  $ cd ..
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   171
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   172
  $ nlinksdir r2/.hg/store
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   173
  1 r2/.hg/store/00changelog.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   174
  1 r2/.hg/store/00manifest.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   175
  1 r2/.hg/store/data/d1/f2.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   176
  1 r2/.hg/store/data/f1.i
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   177
  1 r2/.hg/store/fncache
70b043405400 tests: add test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
   178
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   179
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   180
  $ cd r3
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   181
  $ hg tip --template '{rev}:{node|short}\n'
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   182
  11:a6451b6bc41f
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   183
  $ echo bla > f1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   184
  $ hg ci -m1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   185
  $ cd ..
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   186
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   187
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
   188
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   189
  $ linkcp r3 r4
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   190
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   191
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
   192
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   193
  $ nlinksdir r4
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   194
  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
   195
  2 r4/.hg/branch
13272
5ccdca7df211 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents: 13034
diff changeset
   196
  2 r4/.hg/cache/branchheads
5ccdca7df211 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents: 13034
diff changeset
   197
  2 r4/.hg/cache/tags
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   198
  2 r4/.hg/dirstate
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   199
  2 r4/.hg/hgrc
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   200
  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
   201
  2 r4/.hg/requires
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   202
  2 r4/.hg/store/00changelog.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   203
  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
   204
  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
   205
  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
   206
  2 r4/.hg/store/data/f1.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   207
  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
   208
  2 r4/.hg/store/phaseroots
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   209
  2 r4/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15444
diff changeset
   210
  2 r4/.hg/store/undo.phaseroots
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13272
diff changeset
   211
  2 r4/.hg/undo.bookmarks
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   212
  2 r4/.hg/undo.branch
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   213
  2 r4/.hg/undo.desc
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   214
  2 r4/.hg/undo.dirstate
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   215
  2 r4/d1/data1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   216
  2 r4/d1/f2
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   217
  2 r4/f1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   218
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   219
Update back to revision 11 in r4 should break hardlink of file f1:
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   220
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   221
  $ hg -R r4 up 11
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   222
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   223
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   224
  $ nlinksdir r4
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   225
  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
   226
  1 r4/.hg/branch
13272
5ccdca7df211 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents: 13034
diff changeset
   227
  2 r4/.hg/cache/branchheads
5ccdca7df211 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
jfh <jason@jasonfharris.com>
parents: 13034
diff changeset
   228
  2 r4/.hg/cache/tags
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   229
  1 r4/.hg/dirstate
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   230
  2 r4/.hg/hgrc
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   231
  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
   232
  2 r4/.hg/requires
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   233
  2 r4/.hg/store/00changelog.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   234
  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
   235
  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
   236
  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
   237
  2 r4/.hg/store/data/f1.i
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   238
  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
   239
  2 r4/.hg/store/phaseroots
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   240
  2 r4/.hg/store/undo
15455
c6f87bdab2a1 phases: add rollback support
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15444
diff changeset
   241
  2 r4/.hg/store/undo.phaseroots
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13272
diff changeset
   242
  2 r4/.hg/undo.bookmarks
13019
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   243
  2 r4/.hg/undo.branch
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   244
  2 r4/.hg/undo.desc
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   245
  2 r4/.hg/undo.dirstate
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   246
  2 r4/d1/data1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   247
  2 r4/d1/f2
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   248
  1 r4/f1
42ac864ed394 test-hardlinks: add testcase for repo copied with 'cp -al'
Adrian Buehlmann <adrian@cadifra.com>
parents: 12967
diff changeset
   249
13034
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   250
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   251
Test hardlinking outside hg:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   252
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   253
  $ mkdir x
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   254
  $ echo foo > x/a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   255
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   256
  $ linkcp x y
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   257
  $ echo bar >> y/a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   258
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   259
No diff if hardlink:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   260
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   261
  $ 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
   262
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   263
Test mq hardlinking:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   264
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   265
  $ echo "[extensions]" >> $HGRCPATH
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   266
  $ echo "mq=" >> $HGRCPATH
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   267
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   268
  $ hg init a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   269
  $ cd a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   270
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   271
  $ 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
   272
  > # HG changeset patch
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   273
  > # Date 1 0
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   274
  > diff -r 2588a8b53d66 a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   275
  > --- /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
   276
  > +++ 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
   277
  > @@ -0,0 +1,1 @@
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   278
  > +a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   279
  > EOF
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   280
  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
   281
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   282
  $ hg qpush
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   283
  applying foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   284
  now at: foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   285
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   286
  $ cd ..
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   287
  $ linkcp a b
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   288
  $ cd b
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   289
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   290
  $ 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
   291
  > # HG changeset patch
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   292
  > # Date 2 0
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   293
  > diff -r 2588a8b53d66 a
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   294
  > --- /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
   295
  > +++ 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
   296
  > @@ -0,0 +1,1 @@
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   297
  > +b
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   298
  > EOF
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   299
  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
   300
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   301
  $ hg qpush
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   302
  applying bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   303
  now at: bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   304
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   305
  $ cat .hg/patches/status
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   306
  430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   307
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   308
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   309
  $ cat .hg/patches/series
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   310
  foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   311
  bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   312
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   313
  $ 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
   314
  430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   315
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   316
  $ 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
   317
  foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   318
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   319
Test tags hardlinking:
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   320
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   321
  $ 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
   322
  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
   323
  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
   324
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   325
  $ hg tag -l lfoo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   326
  $ hg tag foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   327
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   328
  $ cd ..
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   329
  $ linkcp b c
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   330
  $ cd c
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   331
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   332
  $ 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
   333
  $ 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
   334
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   335
  $ cat .hgtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   336
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   337
  430ed4828a74fa4047bc816a25500f7472ab4bfe bar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   338
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   339
  $ cat .hg/localtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   340
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   341
  430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   342
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   343
  $ cat ../b/.hgtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   344
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   345
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   346
  $ cat ../b/.hg/localtags
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   347
  4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
8cb33163b391 tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 13019
diff changeset
   348
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15659
diff changeset
   349
  $ cd ..