tests/test-merge-default
author Matt Mackall <mpm@selenic.com>
Thu, 19 Aug 2010 11:14:09 -0500
changeset 11985 81edef14922e
parent 10658 95c7c4b7e67a
permissions -rwxr-xr-x
log: add logging for commands
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
hg init
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
echo a > a
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
hg commit -A -ma
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
10504
d2c1fc440533 test-merge-default: make content of test repo clearer.
Greg Ward <greg-hg@gerg.ca>
parents: 10355
diff changeset
     7
echo b >> a
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     8
hg commit -mb
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
10504
d2c1fc440533 test-merge-default: make content of test repo clearer.
Greg Ward <greg-hg@gerg.ca>
parents: 10355
diff changeset
    10
echo c >> a
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
hg commit -mc
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
hg up 1
10504
d2c1fc440533 test-merge-default: make content of test repo clearer.
Greg Ward <greg-hg@gerg.ca>
parents: 10355
diff changeset
    14
echo d >> a
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
hg commit -md
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    17
hg up 1
10504
d2c1fc440533 test-merge-default: make content of test repo clearer.
Greg Ward <greg-hg@gerg.ca>
parents: 10355
diff changeset
    18
echo e >> a
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    19
hg commit -me
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    21
hg up 1
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    22
echo % should fail because not at a head
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    23
hg merge
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    24
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    25
hg up
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    26
echo % should fail because \> 2 heads
10658
95c7c4b7e67a test-merge-default and check-code.py: No "export x=x" in sh
Mads Kiilerich <mads@kiilerich.com>
parents: 10505
diff changeset
    27
HGMERGE=internal:other; export HGMERGE
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    28
hg merge
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    29
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    30
echo % should succeed
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    31
hg merge 2
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    32
hg commit -mm1
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    33
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    34
echo % should succeed - 2 heads
8834
6d36fc70754e merge: rename -S/--show option to -P/--preview
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8387
diff changeset
    35
hg merge -P
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    36
hg merge
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    37
hg commit -mm2
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    38
5242
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2915
diff changeset
    39
echo % should fail because at tip
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2915
diff changeset
    40
hg merge
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2915
diff changeset
    41
9cd6578750b9 improve error message for 'hg merge' when repo already at branchtip
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2915
diff changeset
    42
hg up 0
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    43
echo % should fail because 1 head
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    44
hg merge
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    45
10355
a5576908b589 merge: add hints about the use of 'hg heads' to find the rev to merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8834
diff changeset
    46
hg up 3
10504
d2c1fc440533 test-merge-default: make content of test repo clearer.
Greg Ward <greg-hg@gerg.ca>
parents: 10355
diff changeset
    47
echo f >> a
10355
a5576908b589 merge: add hints about the use of 'hg heads' to find the rev to merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8834
diff changeset
    48
hg branch foobranch
a5576908b589 merge: add hints about the use of 'hg heads' to find the rev to merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8834
diff changeset
    49
hg commit -mf
a5576908b589 merge: add hints about the use of 'hg heads' to find the rev to merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8834
diff changeset
    50
echo % should fail because merge with other branch
a5576908b589 merge: add hints about the use of 'hg heads' to find the rev to merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8834
diff changeset
    51
hg merge
a5576908b589 merge: add hints about the use of 'hg heads' to find the rev to merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8834
diff changeset
    52
10505
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    53
# Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    54
# are not ancestors of 7, regardless of where their least common
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    55
# ancestor is.
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    56
echo % merge preview not affected by common ancestor
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    57
hg up -q 7
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    58
hg merge -q -P 6         # expect: 2, 4, 5, 6
b3311e26f94f merge: fix --preview to show all nodes that will be merged (issue2043).
Greg Ward <greg-hg@gerg.ca>
parents: 10504
diff changeset
    59
2915
013921c753bd merge with other head by default, not tip.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    60
true