Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / bugs / issue1013_either_dependency.sh
blob385ba76fb9f3c8eb631678a8a0ead12686bee164
1 #!/usr/bin/env bash
2 set -ev
3 export DARCS_EMAIL=test
4 rm -rf tmp_d1 tmp_d2 tmp_d
5 # Preparations:
6 # Set up two repos, each with a patch (d1 and d2 respectively) with both
7 # an individual change and a change that is identical in both repos,
8 # and thus auto-merge, i.e., they don't conflict in darcs2. Pull them
9 # together and record a patch (problem) on top of the auto-merged change,
10 # so that it depends on EITHER of two patches.
12 mkdir tmp_d1; cd tmp_d1
13 darcs init --darcs-2
14 echo a > a
15 echo b > b
16 echo c > c
17 darcs rec -alm init
18 echo a-independent > a
19 echo c-common > c
20 darcs rec -am d1
21 cd ..
22 darcs get --to-patch init tmp_d1 tmp_d2
23 cd tmp_d2
24 echo b-independent > b
25 echo c-common > c
26 darcs rec -am d2
27 darcs pull -a ../tmp_d1
28 # no conflicts -- c-common is identical
29 echo c-problem > c
30 darcs rec -am problem
31 cd ..
33 # I want to pull the 'problem' patch, but expect darcs to get confused
34 # because it doesn't know how to select one of the two dependent patches.
36 darcs get --to-patch init tmp_d2 tmp_d
37 cd tmp_d
38 echo n/n/y |tr / \\012 |darcs pull ../tmp_d2
39 darcs cha
41 # This is weird, we got d2 though we said No. I would have expected
42 # darcs to skip the 'problem' patch in this case.
44 # Try to pull d1 and unpull d2.
46 darcs pull -a ../tmp_d1
47 exit 1 # darcs hangs here (2.0.2+77)!
48 echo n/y/d |tr / \\012 |darcs obl -p d2
50 # The obliterate fails with: patches to commute_to_end does not commutex (1)
52 cd ..
53 rm -rf tmp_d1 tmp_d2 tmp_d