tests/test-http-clone-r
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Sat, 09 Jun 2007 01:04:28 -0300
changeset 4531 b51a8138292a
parent 3853 c0b449154a90
child 5384 e3a0c092b4e2
permissions -rwxr-xr-x
Avoid extra filelogs entries. Right now, there are some situations in which localrepo.filecommit can create filelog entries even though they're not needed. For example: - permissions for a file have changed; - qrefresh can create a filelog entry identical to its parent (see the added test); - convert-repo creates extra filelog entries in every merge where the first parent has added files (for example, changeset ebebe9577a1a of the kernel repo added extra filelog entries to files in the arch/blackfin directory, even though the merge should only touch the drivers/ata directory). This makes "hg log file" in a converted repo less useful than it could be, since it may mention many merges that don't actually touch that specific file. They all come from the same basic problem: localrepo.commit (through filecommit) creates new filelog entries for all files passed to it (except for some cases during a merge). Patch and test case provided by Benoit. This should fix issue351.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3449
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     1
#!/bin/sh
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     2
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     3
hg init remote
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     4
cd remote
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     5
echo "# creating 'remote'"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     6
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     7
0
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     8
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     9
hg add afile
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    10
hg commit -m "0.0"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    11
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    12
1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    13
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    14
hg commit -m "0.1"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    15
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    16
2
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    17
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    18
hg commit -m "0.2"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    19
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    20
3
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    21
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    22
hg commit -m "0.3"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    23
hg update -C 0
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    24
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    25
1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    26
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    27
hg commit -m "1.1"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    28
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    29
2
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    30
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    31
hg commit -m "1.2"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    32
cat >fred <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    33
a line
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    34
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    35
cat >>afile <<EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    36
3
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    37
EOF
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    38
hg add fred
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    39
hg commit -m "1.3"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    40
hg mv afile adifferentfile
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    41
hg commit -m "1.3m"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    42
hg update -C 3
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    43
hg mv afile anotherfile
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    44
hg commit -m "0.3m"
3853
c0b449154a90 switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3449
diff changeset
    45
hg debugindex .hg/store/data/afile.i
c0b449154a90 switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3449
diff changeset
    46
hg debugindex .hg/store/data/adifferentfile.i
c0b449154a90 switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3449
diff changeset
    47
hg debugindex .hg/store/data/anotherfile.i
c0b449154a90 switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3449
diff changeset
    48
hg debugindex .hg/store/data/fred.i
c0b449154a90 switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3449
diff changeset
    49
hg debugindex .hg/store/00manifest.i
3449
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    50
hg verify
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    51
echo "# Starting server"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    52
hg serve -p 20061 -d --pid-file=../hg1.pid
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    53
cd ..
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    54
cat hg1.pid >> $DAEMON_PIDS
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    55
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    56
echo "# clone remote via stream"
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    57
for i in 0 1 2 3 4 5 6 7 8; do
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    58
   hg clone -r "$i" http://localhost:20061/ test-"$i" 2>&1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    59
   if cd test-"$i"; then
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    60
      hg verify
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    61
      cd ..
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    62
   fi
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    63
done
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    64
cd test-8
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    65
hg pull ../test-7
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    66
hg verify
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    67
cd ..
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    68
cd test-1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    69
hg pull -r 4 http://localhost:20061/ 2>&1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    70
hg verify
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    71
hg pull http://localhost:20061/ 2>&1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    72
cd ..
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    73
cd test-2
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    74
hg pull -r 5 http://localhost:20061/ 2>&1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    75
hg verify
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    76
hg pull http://localhost:20061/ 2>&1
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    77
hg verify
c8686e3f0291 Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    78
cd ..