blob: 63c43ffb6be91a16aba96e0a87dbda9ae1d3b9e4 (
plain) (
blame)
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
73
74
75
76
|
##
# systrunk <command> [<options>, ...]
#
# A version control system powered by rsync, focused on tracking large
# directory trees with large files, even binary files; system images.
#
# Main function, decide what to do ...
##
function main
{
if [ $# -eq 0 ]; then
echo "Fatal: no command given" >&2
exit 1
fi
cmd="$1"
shift
if [ ! -f ".systr/BASE" ]; then
if [[ "$cmd" == "checkout" ]]; then
systr_checkout "$@"
elif [[ "$cmd" == "init" ]]; then
systr_init "$@"
elif [[ "$cmd" == "clone" ]]; then
systr_clone "$@"
else
echo "Fatal: not in a worktree" >&2
exit 1
fi
exit
fi
read path <.systr/path
read BASE <.systr/BASE
read TRAC <.systr/TRAC
read MERG <.systr/MERG
read updated <.systr/updated
if [[ "$cmd" == "status" ]]; then
systr_status "$@"
elif [[ "$cmd" == "init" ]]; then
systr_init "$@"
elif [[ "$cmd" == "clone" ]]; then
systr_clone "$@"
elif [[ "$cmd" == "checkout" ]]; then
systr_checkout "$@"
elif [[ "$cmd" == "commit" ]]; then
systr_commit "$@"
elif [[ "$cmd" == "reset" ]]; then
systr_reset "$@"
elif [[ "$cmd" == "tag" ]]; then
systr_repo_tag "$@"
elif [[ "$cmd" == "shortlog" ]]; then
systr_short_log "$@"
elif [[ "$cmd" == "log" ]]; then
systr_log "$@"
elif [[ "$cmd" == "shortdiff" ]]; then
systr_short_diff "$@"
elif [[ "$cmd" == "diff" ]]; then
systr_diff "$@"
elif [[ "$cmd" == "merge" ]]; then
systr_merge "$@"
elif [[ "$cmd" == "update" ]]; then
systr_merge "TRAC" "$@"
elif [[ "$cmd" == "apply-merge" ]]; then
systr_merge_finish "$MERG" "$@"
elif [[ "$cmd" == "abort-merge" ]]; then
systr_merge_abort "$@"
else
echo "Fatal: $cmd not recognized" >&2
exit 1
fi
}
main "$@"
|