tests/fish-merge
author mpm@selenic.com
Tue, 21 Jun 2005 17:50:37 -0800
changeset 402 2fe8d66e3075
parent 28 9f64ee817199
child 544 3d4d5f2aba9a
child 547 4fc63e22b1fe
permissions -rw-r--r--
[PATCH] (3/4) Removing an added file -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] (3/4) Removing an added file From: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk> Here's an hg changeset that deals with "hg add"ing and then "hg remove"ing a file without ever committing it. Previously, this caused a python exception at commit time. Test case included in the patch. manifest hash: 4d012f3f8b1aa664fed9e8bc2849931b28728acd -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuMPtywK+sNU5EO8RAuxMAKCmeMLqOUBmUfCfbQgYOAysOvKkwgCfcJai 2My0M7KqhwnJSbZXbGIOcow= =N7N0 -----END PGP SIGNATURE-----
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     1
set -e
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     2
set -x
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     3
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     4
# skip commit logs
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     5
export HGMERGE=tkmerge
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     6
export EDITOR=true
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     7
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     8
rm -rf m m1 m2
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
     9
mkdir m
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    10
cd m
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    11
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    12
echo "m     this  that"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    13
echo "this" > a
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    14
echo "that" > b
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    15
hg init
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    16
hg addremove
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    17
hg commit
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    18
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    19
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    20
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    21
cd ..
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    22
echo "m2    this  that "
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    23
mkdir m2
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    24
cd m2
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    25
hg branch ../m
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    26
hg checkout
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    27
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    28
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    29
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    30
cd ../m
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    31
echo "m     this1 that "
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    32
echo "this1" > a
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    33
hg commit
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    34
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    35
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    36
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    37
cd ..
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    38
echo "m1    this1 that "
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    39
mkdir m1
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    40
cd m1
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    41
hg branch ../m
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    42
hg checkout
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    43
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    44
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    45
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    46
cd ../m1
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    47
echo "m1    this1 that1"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    48
echo "that1" > b
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    49
hg commit
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    50
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    51
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    52
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    53
cd ../m2
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    54
echo "m2    this  that2"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    55
echo "that2" > b
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    56
hg commit
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    57
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    58
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    59
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    60
cd ../m1
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    61
echo "m1:m2 this1 that1 that2"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    62
hg merge ../m2 # b should conflict, a should be fine
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    63
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    64
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    65
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    66
cd ../m2
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    67
echo "m2    this2 that2"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    68
echo "this2" > a
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    69
hg commit
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    70
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    71
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    72
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    73
cd ../m2
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    74
echo "m2:m this12 that2"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    75
hg merge ../m # a should conflict, b should be fine
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    76
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    77
echo
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    78
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    79
# now here's the interesting bit
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    80
# if we choose ancestor by file, no conflicts
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    81
# otherwise we've got two equally close ancestors, each with a conflict
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    82
# if we go back to the root, we'll have both conflicts again
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    83
echo "m2:m1 this12 that12"
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    84
hg merge ../m1 # should be clean
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    85
echo "a:" `hg dump a` "b:" `hg dump b`
9f64ee817199 Add some tests to the repo
mpm@selenic.com
parents:
diff changeset
    86
echo