tests/test-walk
author mpm@selenic.com
Sun, 21 Aug 2005 21:59:55 -0700
changeset 990 5007e0bdeed2
parent 896 01215ad04283
child 1413 1c64c628d15f
permissions -rwxr-xr-x
Fix long-standing excessive file merges Since switching to the multihead approach, we've been creating excessive file-level merges where files are marked as merged with their ancestors. This explicitly checks at commit time whether the two parent versions are linearly related, and if so, reduces the file check-in to a non-merge. Then the file is compared against the remaining parent, and, if equal, skips check-in of that file (as it's not changed). Since we're not checking in all files that were different between versions, we no longer need to mark so many files for merge. This removes most of the 'm' state marking as well. Finally, it is possible to do a tree-level merge with no file-level changes. This will happen if one user changes file A and another changes file B. Thus, if we have have two parents, we allow commit to proceed even if there are no file-level changes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
889
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     1
#!/bin/sh
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     3
mkdir t
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     4
cd t
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     5
hg init
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     6
mkdir -p beans
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     7
for b in kidney navy turtle borlotti black pinto; do
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     8
    echo $b > beans/$b
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     9
done
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    10
mkdir -p mammals/Procyonidae
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    11
for m in cacomistle coatimundi raccoon; do
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    12
    echo $m > mammals/Procyonidae/$m
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    13
done
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    14
echo skunk > mammals/skunk
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    15
echo fennel > fennel
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
echo fenugreek > fenugreek
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    17
echo fiddlehead > fiddlehead
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    18
echo glob:glob > glob:glob
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    19
hg addremove
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    20
hg commit -m "commit #0" -d "0 0"
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    21
hg debugwalk
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    22
cd mammals
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
hg debugwalk
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    24
hg debugwalk Procyonidae
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    25
cd Procyonidae
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    26
hg debugwalk
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    27
hg debugwalk ..
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    28
cd ..
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    29
hg debugwalk ../beans
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    30
hg debugwalk
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    31
cd ..
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    32
hg debugwalk -Ibeans
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    33
hg debugwalk 'mammals/../beans/b*'
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    34
hg debugwalk '-X*/Procyonidae' mammals
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    35
hg debugwalk path:mammals
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    36
hg debugwalk ..
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    37
hg debugwalk beans/../..
893
36c991554ebb Turn off testing of absolute paths for now.
Bryan O'Sullivan <bos@serpentine.com>
parents: 889
diff changeset
    38
# Don't know how to test absolute paths without always getting a false
36c991554ebb Turn off testing of absolute paths for now.
Bryan O'Sullivan <bos@serpentine.com>
parents: 889
diff changeset
    39
# error.
36c991554ebb Turn off testing of absolute paths for now.
Bryan O'Sullivan <bos@serpentine.com>
parents: 889
diff changeset
    40
#hg debugwalk `pwd`/beans
36c991554ebb Turn off testing of absolute paths for now.
Bryan O'Sullivan <bos@serpentine.com>
parents: 889
diff changeset
    41
#hg debugwalk `pwd`/..
889
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    42
hg debugwalk glob:\*
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    43
hg debugwalk 're:.*[kb]$'
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    44
hg debugwalk path:beans/black
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    45
hg debugwalk beans 'beans/*'
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    46
hg debugwalk 'j*'
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    47
hg debugwalk NOEXIST
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    48
mkfifo fifo
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    49
hg debugwalk fifo
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    50
rm fenugreek
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    51
hg debugwalk fenugreek
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    52
hg rm fenugreek
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    53
hg debugwalk fenugreek
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    54
touch new
0a06d9d373c3 Add unit tests for walk code.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    55
hg debugwalk new