Show More
@@ -1,112 +1,165 b'' | |||||
1 | #!/bin/sh |
|
1 | $ cat <<EOF > merge | |
2 |
|
2 | > import sys, os | ||
3 | cat <<EOF > merge |
|
3 | > | |
4 | import sys, os |
|
4 | > try: | |
|
5 | > import msvcrt | |||
|
6 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |||
|
7 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |||
|
8 | > except ImportError: | |||
|
9 | > pass | |||
|
10 | > | |||
|
11 | > print "merging for", os.path.basename(sys.argv[1]) | |||
|
12 | > EOF | |||
|
13 | $ HGMERGE="python ../merge"; export HGMERGE | |||
5 |
|
14 | |||
6 | try: |
|
15 | $ mkdir t | |
7 | import msvcrt |
|
16 | $ cd t | |
8 | msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
17 | $ hg init | |
9 | msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
18 | $ echo This is file a1 > a | |
10 | except ImportError: |
|
19 | $ hg add a | |
11 | pass |
|
20 | $ hg commit -m "commit #0" -d "1000000 0" | |
12 |
|
21 | $ echo This is file b1 > b | ||
13 | print "merging for", os.path.basename(sys.argv[1]) |
|
22 | $ hg add b | |
14 | EOF |
|
23 | $ hg commit -m "commit #1" -d "1000000 0" | |
15 | HGMERGE="python ../merge"; export HGMERGE |
|
|||
16 |
|
24 | |||
17 | mkdir t |
|
25 | $ hg update 0 | |
18 | cd t |
|
26 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
19 | hg init |
|
27 | $ echo This is file c1 > c | |
20 | echo This is file a1 > a |
|
28 | $ hg add c | |
21 | hg add a |
|
29 | $ hg commit -m "commit #2" -d "1000000 0" | |
22 | hg commit -m "commit #0" -d "1000000 0" |
|
30 | created new head | |
23 | echo This is file b1 > b |
|
31 | $ echo This is file b1 > b | |
24 | hg add b |
|
32 | no merges expected | |
25 | hg commit -m "commit #1" -d "1000000 0" |
|
33 | $ hg merge -P 1 | |
|
34 | changeset: 1:4ee19afe4659 | |||
|
35 | user: test | |||
|
36 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
37 | summary: commit #1 | |||
26 |
|
38 | |||
27 | hg update 0 |
|
39 | $ hg merge 1 | |
28 | echo This is file c1 > c |
|
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
29 | hg add c |
|
41 | (branch merge, don't forget to commit) | |
30 | hg commit -m "commit #2" -d "1000000 0" |
|
42 | $ hg diff --nodates | |
31 | echo This is file b1 > b |
|
43 | diff -r d9e5953b9dec b | |
32 | echo %% no merges expected |
|
44 | --- /dev/null | |
33 | hg merge -P 1 |
|
45 | +++ b/b | |
34 | hg merge 1 |
|
46 | @@ -0,0 +1,1 @@ | |
35 | hg diff --nodates |
|
47 | +This is file b1 | |
36 | hg status |
|
48 | $ hg status | |
37 | cd ..; rm -r t |
|
49 | M b | |
|
50 | $ cd ..; rm -r t | |||
38 |
|
51 | |||
39 | mkdir t |
|
52 | $ mkdir t | |
40 | cd t |
|
53 | $ cd t | |
41 | hg init |
|
54 | $ hg init | |
42 | echo This is file a1 > a |
|
55 | $ echo This is file a1 > a | |
43 | hg add a |
|
56 | $ hg add a | |
44 | hg commit -m "commit #0" -d "1000000 0" |
|
57 | $ hg commit -m "commit #0" -d "1000000 0" | |
45 | echo This is file b1 > b |
|
58 | $ echo This is file b1 > b | |
46 | hg add b |
|
59 | $ hg add b | |
47 | hg commit -m "commit #1" -d "1000000 0" |
|
60 | $ hg commit -m "commit #1" -d "1000000 0" | |
48 |
|
61 | |||
49 | hg update 0 |
|
62 | $ hg update 0 | |
50 | echo This is file c1 > c |
|
63 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
51 | hg add c |
|
64 | $ echo This is file c1 > c | |
52 | hg commit -m "commit #2" -d "1000000 0" |
|
65 | $ hg add c | |
53 | echo This is file b2 > b |
|
66 | $ hg commit -m "commit #2" -d "1000000 0" | |
54 | echo %% merge should fail |
|
67 | created new head | |
55 | hg merge 1 |
|
68 | $ echo This is file b2 > b | |
56 | echo %% merge of b expected |
|
69 | merge should fail | |
57 |
hg merge |
|
70 | $ hg merge 1 | |
58 | hg diff --nodates |
|
71 | abort: untracked file in working directory differs from file in requested revision: 'b' | |
59 | hg status |
|
72 | merge of b expected | |
60 | cd ..; rm -r t |
|
73 | $ hg merge -f 1 | |
61 | echo %% |
|
74 | merging for b | |
|
75 | merging b | |||
|
76 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
77 | (branch merge, don't forget to commit) | |||
|
78 | $ hg diff --nodates | |||
|
79 | diff -r d9e5953b9dec b | |||
|
80 | --- /dev/null | |||
|
81 | +++ b/b | |||
|
82 | @@ -0,0 +1,1 @@ | |||
|
83 | +This is file b2 | |||
|
84 | $ hg status | |||
|
85 | M b | |||
|
86 | $ cd ..; rm -r t | |||
62 |
|
87 | |||
63 | mkdir t |
|
88 | $ mkdir t | |
64 | cd t |
|
89 | $ cd t | |
65 | hg init |
|
90 | $ hg init | |
66 | echo This is file a1 > a |
|
91 | $ echo This is file a1 > a | |
67 | hg add a |
|
92 | $ hg add a | |
68 | hg commit -m "commit #0" -d "1000000 0" |
|
93 | $ hg commit -m "commit #0" -d "1000000 0" | |
69 | echo This is file b1 > b |
|
94 | $ echo This is file b1 > b | |
70 | hg add b |
|
95 | $ hg add b | |
71 | hg commit -m "commit #1" -d "1000000 0" |
|
96 | $ hg commit -m "commit #1" -d "1000000 0" | |
72 | echo This is file b22 > b |
|
97 | $ echo This is file b22 > b | |
73 | hg commit -m "commit #2" -d "1000000 0" |
|
98 | $ hg commit -m "commit #2" -d "1000000 0" | |
74 | hg update 1 |
|
99 | $ hg update 1 | |
75 | echo This is file c1 > c |
|
100 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
76 | hg add c |
|
101 | $ echo This is file c1 > c | |
77 | hg commit -m "commit #3" -d "1000000 0" |
|
102 | $ hg add c | |
|
103 | $ hg commit -m "commit #3" -d "1000000 0" | |||
|
104 | created new head | |||
|
105 | ||||
|
106 | Contents of b should be "this is file b1" | |||
|
107 | $ cat b | |||
|
108 | This is file b1 | |||
78 |
|
109 | |||
79 | echo 'Contents of b should be "this is file b1"' |
|
110 | $ echo This is file b22 > b | |
80 | cat b |
|
111 | merge fails | |
81 |
|
112 | $ hg merge 2 | ||
82 | echo This is file b22 > b |
|
113 | abort: outstanding uncommitted changes (use 'hg status' to list changes) | |
83 |
echo %% merge |
|
114 | $ echo %% merge expected! | |
84 | hg merge 2 |
|
115 | %% merge expected! | |
85 | echo %% merge expected! |
|
116 | $ hg merge -f 2 | |
86 | hg merge -f 2 |
|
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
87 | hg diff --nodates |
|
118 | (branch merge, don't forget to commit) | |
88 | hg status |
|
119 | $ hg diff --nodates | |
89 | cd ..; rm -r t |
|
120 | diff -r c1dd73cbf59f b | |
|
121 | --- a/b | |||
|
122 | +++ b/b | |||
|
123 | @@ -1,1 +1,1 @@ | |||
|
124 | -This is file b1 | |||
|
125 | +This is file b22 | |||
|
126 | $ hg status | |||
|
127 | M b | |||
|
128 | $ cd ..; rm -r t | |||
90 |
|
129 | |||
91 | mkdir t |
|
130 | $ mkdir t | |
92 | cd t |
|
131 | $ cd t | |
93 | hg init |
|
132 | $ hg init | |
94 | echo This is file a1 > a |
|
133 | $ echo This is file a1 > a | |
95 | hg add a |
|
134 | $ hg add a | |
96 | hg commit -m "commit #0" -d "1000000 0" |
|
135 | $ hg commit -m "commit #0" -d "1000000 0" | |
97 | echo This is file b1 > b |
|
136 | $ echo This is file b1 > b | |
98 | hg add b |
|
137 | $ hg add b | |
99 | hg commit -m "commit #1" -d "1000000 0" |
|
138 | $ hg commit -m "commit #1" -d "1000000 0" | |
100 | echo This is file b22 > b |
|
139 | $ echo This is file b22 > b | |
101 | hg commit -m "commit #2" -d "1000000 0" |
|
140 | $ hg commit -m "commit #2" -d "1000000 0" | |
102 | hg update 1 |
|
141 | $ hg update 1 | |
103 | echo This is file c1 > c |
|
142 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
104 | hg add c |
|
143 | $ echo This is file c1 > c | |
105 | hg commit -m "commit #3" -d "1000000 0" |
|
144 | $ hg add c | |
106 | echo This is file b33 > b |
|
145 | $ hg commit -m "commit #3" -d "1000000 0" | |
107 | echo %% merge of b should fail |
|
146 | created new head | |
108 | hg merge 2 |
|
147 | $ echo This is file b33 > b | |
109 | echo %% merge of b expected |
|
148 | merge of b should fail | |
110 |
hg merge |
|
149 | $ hg merge 2 | |
111 | hg diff --nodates |
|
150 | abort: outstanding uncommitted changes (use 'hg status' to list changes) | |
112 | hg status |
|
151 | merge of b expected | |
|
152 | $ hg merge -f 2 | |||
|
153 | merging for b | |||
|
154 | merging b | |||
|
155 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
156 | (branch merge, don't forget to commit) | |||
|
157 | $ hg diff --nodates | |||
|
158 | diff -r c1dd73cbf59f b | |||
|
159 | --- a/b | |||
|
160 | +++ b/b | |||
|
161 | @@ -1,1 +1,1 @@ | |||
|
162 | -This is file b1 | |||
|
163 | +This is file b33 | |||
|
164 | $ hg status | |||
|
165 | M b |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now