-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrec-un-rec.sh
executable file
·56 lines (44 loc) · 1.03 KB
/
rec-un-rec.sh
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
#!/usr/bin/env bash
set -x -e
p='patch'
u=$(uname)
if [ "$u" = "FreeBSD" ] || [ "$u" = "NetBSD" ]; then
p='gpatch'
fi
source ./functions.sh
cd ..
rm -rf pijul-tests-data
mkdir pijul-tests-data
cd pijul-tests-data
pijul init repo
cd repo
tar -xJf ../../pijul-tests/kernel/linux-2.0.1.tar.xz --strip-components=1
add
record
eq 2143 "$(pijul ls | wc -l)"
for i in {2..40}; do
xzcat ../../pijul-tests/patches/patch-2.0."$i".xz | "$p" -sp1
add
record
done
eq 2484 "$(pijul ls | wc -l)"
H="$(pijul log --hash-only | head -1)"
pijul fork Reset2040
pijul apply "$H" --channel Reset2040
pijul channel switch Reset2040
for i in {0..38}; do
H="$(pijul log --hash-only | head -1)"
pijul unrecord "$H" --reset
done
pijul channel switch main
for i in {0..38}; do
H="$(pijul log --hash-only | head -1)"
pijul unrecord "$H"
done
eq 2529 "$(pijul ls | wc -l)"
eq 2 "$(pijul log --hash-only | wc -l)"
pijul reset --force
eq 2143 "$(pijul ls | wc -l)"
pijul channel switch Reset2040
zero "$(pijul diff --channel main | wc -l)"
echo "OK--rec-un-rec"