Follow upstream changes -- rest
[git-darcs-import.git] / tests / conflict-fight.sh
blob234f8b0025972e20b0f589c5dddf7e300046b067
1 #!/usr/bin/env bash
3 set -ev
5 rm -rf temp0 temp1 temp2
7 # step 1
8 mkdir temp0
9 cd temp0
10 darcs init --darcs-2
11 echo temp0 > _darcs/prefs/author
12 echo m1 > foo
13 darcs add foo
14 darcs record -a -m m1 --ignore-times
15 cd ..
17 # step 2
18 darcs get temp0 temp1
19 cd temp1
20 echo temp1 > _darcs/prefs/author
21 echo a1 > foo
22 darcs record foo -a -m a1 --ignore-times
23 cd ..
26 # step 3
27 cd temp0
28 echo m2 > foo
29 darcs record -a -m m2 --ignore-times
30 cd ..
33 # step 4
34 cd temp1
35 darcs pull -a
36 echo m2-a1 > foo
37 darcs record -a -m 'Fix conflict m2-a1' --ignore-times
38 echo a2 > foo
39 darcs record -a -m a2 --ignore-times
40 cd ..
42 #step 5
43 cd temp0
44 echo m3 > foo
45 darcs record -a -m m3 --ignore-times
46 cd ..
48 #step 6
49 darcs get temp0 temp2
50 cd temp2
51 echo temp2 > _darcs/prefs/author
52 echo b1 > foo
53 darcs record -a -m b1 --ignore-times
55 cd ..
57 #step 7
58 cd temp0
59 echo m4 > foo
60 darcs record -a -m m4 --ignore-times
61 cd ..
63 #step 8
64 cd temp1
65 darcs pull -a
66 echo m2-a1-m4 > foo
67 darcs record -a -m 'Fix three-way m2/m2-a1/m4' --ignore-times
68 echo a3 > foo
69 darcs record -a -m a3 --ignore-times
70 cd ..
72 #step 9
73 cd temp1
74 darcs pull -av ../temp2
75 cd ..
77 rm -rf temp0 temp1 temp2