comparison tests/test-merge-closedheads @ 8694:ca8d05e1f1d1

localrepo: set heads and branchheads to be closed=False by default The heads(...) and branchheads(...) functions will now only return closed heads when explicitly asked for them. This will cause 'hg merge' to have better behavior in the presence of a branch that has closed heads when no explicit rev is passed.
author John Mulligan <phlogistonjohn@asynchrono.us>
date Wed, 03 Jun 2009 13:42:55 +0200
parents
children ee876e42dd74
comparison
equal deleted inserted replaced
8693:68e0a55eee6e 8694:ca8d05e1f1d1
1 #!/bin/sh
2
3 hgcommit() {
4 hg commit -u user -d '0 0' "$@"
5 }
6
7 hg init clhead
8 cd clhead
9
10
11 touch foo && hg add && hgcommit -m 'foo'
12 touch bar && hg add && hgcommit -m 'bar'
13 touch baz && hg add && hgcommit -m 'baz'
14
15 echo "flub" > foo
16 hgcommit -m "flub"
17 echo "nub" > foo
18 hgcommit -m "nub"
19
20 hg up -C 2
21
22 echo "c1" > c1
23 hg add c1
24 hgcommit -m "c1"
25 echo "c2" > c1
26 hgcommit -m "c2"
27
28 hg up -C 2
29
30 echo "d1" > d1
31 hg add d1
32 hgcommit -m "d1"
33 echo "d2" > d1
34 hgcommit -m "d2"
35 hg tag -l good
36
37 echo '% fail with three heads'
38 hg up -C good
39 hg merge
40
41 echo '% close one of the heads'
42 hg up -C 6
43 hgcommit -m 'close this head' --close-branch
44
45 echo '% succeed with two open heads'
46 hg up -C good
47 hg up -C good
48 hg merge
49 hgcommit -m 'merged heads'
50
51