blob: 875a225cc0b8d508c431661c690773585fa34b23 (
plain)
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
|
#!/bin/rc
. util.rc
wrkdir=`{pwd}
rm -fr scratch
mkdir -p scratch/upstream
echo @@ version1 @@
@{
cd scratch/upstream
q $G/init
echo version1 > file.txt
q $G/add file.txt
q $G/commit -m version1 file.txt
}
@{
cd scratch
$G/clone $wrkdir/scratch/upstream downstream
}
diff -c scratch/upstream/file.txt scratch/downstream/file.txt || die mismatch
echo @@ version2 @@
@{
cd scratch/upstream
echo version2 > file.txt
q $G/commit -m version2 file.txt
}
@{
cd scratch/downstream
q $G/pull
}
q diff -c scratch/upstream/file.txt scratch/downstream/file.txt || die mismatch
echo @@ version3 @@
@{
cd scratch/upstream
echo version3 > file2.txt
$G/add file2.txt
q $G/commit -m version3 file2.txt
}
@{
cd scratch/downstream
q $G/pull
}
q diff -c scratch/upstream/file.txt scratch/downstream/file.txt || die mismatch
q diff -c scratch/upstream/file2.txt scratch/downstream/file2.txt || die mismatch
echo @@ version4 @@
@{
cd scratch/upstream
echo version4 > file.txt
$G/rm file2.txt
rm file2.txt
q $G/commit -m version4 file.txt file2.txt
}
@{
cd scratch/downstream
q $G/pull
}
q diff -c scratch/upstream/file.txt scratch/downstream/file.txt || die mismatch
! test -e scratch/upstream/file2.txt || die mismatch
! test -e scratch/downstream/file2.txt || die mismatch
|