File: issue2682.sh

package info (click to toggle)
darcs 2.18.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,008 kB
  • sloc: haskell: 47,748; sh: 13,466; ansic: 447; perl: 134; makefile: 6
file content (72 lines) | stat: -rw-r--r-- 1,166 bytes parent folder | download | duplicates (2)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
# test for issue2682: conflict not marked if tag pulled at the same time

. lib

rm -rf R S
darcs init R
cd R
echo initial>file
darcs add file
darcs record -am initial
darcs clone . ../S

# Record a change in R
echo one > file
darcs record -am one
cd ../S

# Record a conflicting change in S
echo two > file
darcs record -am two
cd ..

tag() {
  name=T$1
  rm -rf $name
  darcs clone $1 $name
  cd $name
  darcs tag $name
  cd ..
}

depend() {
  name=D$1
  rm -rf $name
  darcs clone $1 $name
  cd $name
  echo yd | darcs record --ask-deps -m $name
  cd ..
}

runtest() {
  cd $2
  # Pull from R to S
  # Darcs should say there's a conflict and
  # mark it, but instead the pull silently succeeds.
  darcs pull ../$1 -a 2>&1 | tee LOG
  grep -i conflicts LOG
  darcs whatsnew

  # undo the pull
  darcs revert -a
  echo y | darcs obliterate -a --last=2
  # again, this time with --reorder-patches
  darcs pull ../$1 -a --reorder-patches 2>&1 | tee LOG
  grep -i conflicts LOG
  darcs whatsnew
  cd ..
}

# test all 4 combinations of tag/depend
tag R
depend R

tag S
runtest TR TS
depend S
runtest TR DS
tag S
runtest DR TS
depend S
runtest DR DS