Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / bugs / issue1014_identical_patches.sh
blob1a47ed18fe11343ef72a51a511f1d8c0eecb6451
1 #!/usr/bin/env bash
2 set -ev
4 # Set up a base repo. Our experiment will start from this point
5 mkdir base
6 cd base
7 darcs init --darcs-2
8 printf "Line1\nLine2\nLine3\n" > foo
9 darcs rec -alm Base
10 cd ..
12 # Now we want to record patch A, which will turn "Line2" into "Hello"
13 darcs get base a
14 cd a
15 printf "Line1\nHello\nLine3\n" > foo
16 darcs rec --ignore-times -am A
17 cd ..
19 # Make B the same as A
20 darcs get base b
21 cd b
22 printf "Line1\nHello\nLine3\n" > foo
23 darcs rec --ignore-times -am B
24 cd ..
26 # Now we make a patch C that depends on A
27 darcs get a ac
28 cd ac
29 printf "Line1\nWorld\nLine3\n" > foo
30 darcs rec --ignore-times -am C
31 cd ..
33 # Merge A and B
34 darcs get a ab
35 cd ab
36 darcs pull -a ../b
37 darcs revert -a
38 cd ..
40 # And merge in C too
41 darcs get ab abc
42 cd abc
43 darcs pull -a ../ac
44 darcs revert -a
45 cd ..
47 # Now we can pull just B and C into base
48 darcs get base bc
49 cd bc
50 darcs pull ../abc -ap 'B|C'
51 cd ..
53 # Now we have base, B and C in a repository. At this point we're correct.
55 # Let's try merging AC with BC now, here we discover a bug.
57 darcs get ac abc2
58 cd abc2
59 darcs pull -a ../bc