Mercurial > hg
comparison tests/test-merge-closedheads.t @ 11971:71105dd7d4df
tests: unify test-merge-closedheads
author | Pradeepkumar Gayam <in3xes@gmail.com> |
---|---|
date | Wed, 18 Aug 2010 04:21:10 +0530 |
parents | tests/test-merge-closedheads@ee876e42dd74 |
children | 4c94b6d0fb1c |
comparison
equal
deleted
inserted
replaced
11970:fca15617721c | 11971:71105dd7d4df |
---|---|
1 $ hgcommit() { | |
2 > hg commit -u user -d '0 0' "$@" | |
3 > } | |
4 | |
5 $ hg init clhead | |
6 $ cd clhead | |
7 | |
8 $ touch foo && hg add && hgcommit -m 'foo' | |
9 adding foo | |
10 $ touch bar && hg add && hgcommit -m 'bar' | |
11 adding bar | |
12 $ touch baz && hg add && hgcommit -m 'baz' | |
13 adding 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 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | |
23 $ echo "c1" > c1 | |
24 $ hg add c1 | |
25 $ hgcommit -m "c1" | |
26 created new head | |
27 $ echo "c2" > c1 | |
28 $ hgcommit -m "c2" | |
29 | |
30 $ hg up -C 2 | |
31 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
32 | |
33 $ echo "d1" > d1 | |
34 $ hg add d1 | |
35 $ hgcommit -m "d1" | |
36 created new head | |
37 $ echo "d2" > d1 | |
38 $ hgcommit -m "d2" | |
39 $ hg tag -l good | |
40 | |
41 fail with three heads | |
42 $ hg up -C good | |
43 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
44 $ hg merge | |
45 abort: branch 'default' has 3 heads - please merge with an explicit rev | |
46 (run 'hg heads .' to see heads) | |
47 | |
48 close one of the heads | |
49 $ hg up -C 6 | |
50 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
51 $ hgcommit -m 'close this head' --close-branch | |
52 | |
53 succeed with two open heads | |
54 $ hg up -C good | |
55 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
56 $ hg up -C good | |
57 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 $ hg merge | |
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
60 (branch merge, don't forget to commit) | |
61 $ hgcommit -m 'merged heads' | |
62 | |
63 hg update -C 8 | |
64 $ hg update -C 8 | |
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
66 | |
67 hg branch some-branch | |
68 $ hg branch some-branch | |
69 marked working directory as branch some-branch | |
70 hg commit | |
71 $ hgcommit -m 'started some-branch' | |
72 hg commit --close-branch | |
73 $ hgcommit --close-branch -m 'closed some-branch' | |
74 | |
75 hg update default | |
76 $ hg update default | |
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 hg merge some-branch | |
79 $ hg merge some-branch | |
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
81 (branch merge, don't forget to commit) | |
82 hg commit (no reopening of some-branch) | |
83 $ hgcommit -m 'merge with closed branch' | |
84 |