File: decoalesce-replace.sh

package info (click to toggle)
darcs 2.18.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,960 kB
  • sloc: haskell: 47,748; sh: 13,466; ansic: 447; perl: 134; makefile: 8
file content (32 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
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
#!/usr/bin/env bash

. lib

rm -rf R
darcs init R
cd R

touch f
darcs record -lam 'add f'

touch g
darcs add g
darcs replace one two f
rm f

echo nyy | darcs record -m 'add g'

# make sure we recorded the addfile ./g but nothing about f:
darcs log --last=1 -v > log
grep -F 'addfile ./g' log
grep -v -F './f' log

# test that pending still contains the replace that was eliminated
# (in memory) by coalescing it with the detected rm
cat >pending.want <<EOF
replace ./f [A-Za-z_0-9] one two
EOF

diff -u pending.want _darcs/patches/pending >&2

cd ..