File: decoalesce-split.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 (64 lines) | stat: -rw-r--r-- 1,329 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
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
#!/usr/bin/env bash

. lib

rm -rf R
darcs init R
cd R

echo 'version1' > file
darcs record -lam "version1"

# force replace so we have a hunk in pending that we can split
# but no (additional) changes detected in the working tree
darcs replace -f version2 version1 file

echo eyd | DARCS_EDITOR="sed -i -e s/version2/version1.5/" darcs record -m "version1.5" >&2

# test that we correctly removed the recorded hunk which we split off from
# the forced hunk in pending:

cat > expected <<EOF
hunk ./file 1
-version1.5
+version2
replace ./file [A-Za-z_0-9] version2 version1
EOF

darcs whatsnew | diff -u expected - >&2

cd ..

# same test as above but now *with* additional changes in working

rm -rf R
darcs init R
cd R

echo 'version1' > file
touch file2
darcs record -lam "version1"

# force replace so we have a hunk in pending that we can split
darcs replace -f version2 version1 file
darcs move file2 file3
echo text > file3

echo neyd | DARCS_EDITOR="sed -i -e s/version2/version1.5/" darcs record -m "version1.5" >&2

# test that we correctly removed the recorded hunk which we split off from
# the forced hunk in pending:

cat > expected <<EOF
move ./file2 ./file3
hunk ./file 1
-version1.5
+version2
replace ./file [A-Za-z_0-9] version2 version1
hunk ./file3 1
+text
EOF

darcs whatsnew | diff -u expected - >&2

cd ..