4 ## The builtin ! has the wrong semantics for not.
5 not
() { "$@" && exit 1 ||
:; }
7 # Tests for the doppleganger conflict bug.
16 # check that dopplegangers conflict in --old-fashioned
17 rm -rf tmp_dopple tmp_ganger
20 darcs init
--old-fashioned
22 darcs show repo |
grep darcs-1.0
25 darcs record
-A base
-am 'adding a.txt'
28 darcs get tmp_dopple tmp_ganger
30 for repo
in tmp_dopple tmp_ganger
; do
33 echo "text which appears in both places at once" > a.txt
34 darcs record
-A $repo -am "recording an identical change in $repo"
38 # Now that the conflict has been set up, try pull one patch from the other.
40 darcs pull
-a ..
/tmp_dopple
> out
44 # check that dopplegangers conflict in --hashed
45 rm -rf tmp_dopple tmp_ganger
50 darcs show repo |
grep hashed
53 darcs record
-A base
-am 'adding a.txt'
56 darcs get tmp_dopple tmp_ganger
58 for repo
in tmp_dopple tmp_ganger
; do
61 echo "text which appears in both places at once" > a.txt
62 darcs record
-A $repo -am "recording an identical change in $repo"
66 # Now that the conflict has been set up, try pull one patch from the other.
68 darcs pull
-a ..
/tmp_dopple
> out
73 # check that dopplegangers do not conflict in --darcs-2
74 rm -rf tmp_dopple tmp_ganger
79 darcs show repo |
grep darcs-2
82 darcs record
-A base
-am 'adding a.txt'
85 darcs get tmp_dopple tmp_ganger
87 for repo
in tmp_dopple tmp_ganger
; do
90 echo "text which appears in both places at once" > a.txt
91 darcs record
-A $repo -am "recording an identical change in $repo"
95 # Now that the conflict has been set up, try pull one patch from the other.
97 darcs pull
-a ..
/tmp_dopple
> out
99 not
grep 'conflict' out
102 # Checking that resolution dopplegangers conflict in --old-fashioned-inventory
103 rm -rf temp0 temp1 temp2 tmp_dopple tmp_ganger
106 darcs init
--old-fashioned-inventory
107 darcs show repo |
grep darcs-1.0
111 darcs get
--old-fashioned-inventory temp0 temp1
114 darcs show repo |
grep darcs-1.0
117 darcs record
-A base
-am 'adding temp1 a.txt'
119 darcs get temp0 temp2
123 darcs record
-A base
-am 'adding temp2 a.txt'
126 # Resolve the conflict the same way on both sides
127 for repo
in tmp_dopple tmp_ganger
; do
128 echo working on
$repo
129 darcs get temp1
$repo
131 darcs pull
-a ..
/temp2
132 echo "text which appears in both places at once" > a.txt
133 darcs record
-A $repo -am "recording an identical change in $repo"
137 # Now that the conflict has been set up, try pull one patch from the other.
139 darcs pull
-a ..
/tmp_dopple
> out
144 # Checking that resolution dopplegangers conflict in --hashed
145 rm -rf temp0 temp1 temp2 tmp_dopple tmp_ganger
149 darcs show repo |
grep hashed
153 darcs get temp0 temp1
157 darcs record
-A base
-am 'adding temp1 a.txt'
159 darcs get temp0 temp2
163 darcs record
-A base
-am 'adding temp2 a.txt'
166 # Resolve the conflict the same way on both sides
167 for repo
in tmp_dopple tmp_ganger
; do
168 echo working on
$repo
169 darcs get temp1
$repo
171 darcs pull
-a ..
/temp2
172 echo "text which appears in both places at once" > a.txt
173 darcs record
-A $repo -am "recording an identical change in $repo"
177 # Now that the conflict has been set up, try pull one patch from the other.
179 darcs pull
-a ..
/tmp_dopple
> out
185 # Checking that resolution dopplegangers do not conflict in --darcs-2
186 rm -rf temp0 temp1 temp2 tmp_dopple tmp_ganger
190 darcs show repo |
grep darcs-2
194 darcs get temp0 temp1
196 darcs show repo |
grep darcs-2
199 darcs record
-A base
-am 'adding temp1 a.txt'
201 darcs get temp0 temp2
205 darcs record
-A base
-am 'adding temp2 a.txt'
208 # Resolve the conflict the same way on both sides
209 for repo
in tmp_dopple tmp_ganger
; do
210 echo working on
$repo
211 darcs get temp1
$repo
213 darcs pull
-a ..
/temp2
214 echo "text which appears in both places at once" > a.txt
215 darcs record
-A $repo -am "recording an identical change in $repo"
219 # Now that the conflict has been set up, try pull one patch from the other.
221 darcs pull
-a ..
/tmp_dopple
> out
223 not
grep conflict out