File: conflict-fight-failure.sh

package info (click to toggle)
darcs 2.0.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,400 kB
  • ctags: 1,048
  • sloc: haskell: 24,937; perl: 9,736; sh: 3,369; ansic: 1,913; makefile: 17; xml: 14
file content (54 lines) | stat: -rw-r--r-- 861 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/env bash
#
# Test darcs conflict fight scenario.
#
# Set up two repos RA and RB. Create conflict in RB. 
# After resolving conflict in RB, pull new patch from RA.
# Repeat, rinse.
#
# Author: Pekka Pessi
#

set -ev

record="record --ignore-time --all --author X"

rm -rf RA RB
mkdir RA

cd RA
echo 0 > file
darcs init
darcs add file
darcs $record -m0 file
cd ..

darcs get RA RB

# Create conflict in RB
cd RB
echo let it b > file
darcs $record -m B
cd ..

for i in 1 2 3 4 5 # 6 7 8 9 10 11 12
do
  echo Create new patch A$i in RA
  cd RA
  echo a$i > file
  darcs $record -m A$i
  cd ..

  echo Pull patch A$i from RA and get a conflict
  cd RB
  time darcs pull ../RA --verbose --all --patch "^A$i\$"
  cd ..

  echo Resolve conflict and start fighting by recording B$i
  cd RB
  echo let it b > file
  darcs $record -m B$i
  cd ..
done

rm -rf RA RB