-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreview-diff
More file actions
executable file
·36 lines (28 loc) · 817 Bytes
/
Copy pathreview-diff
File metadata and controls
executable file
·36 lines (28 loc) · 817 Bytes
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
#!/bin/bash
set -e; set -o pipefail; source __review-shared.sh
if [[ $# -lt 1 ]]; then
error "usage: $(basename $0) [name] <prev version> <version> or <version>"
fi
name=$1
prev_version=$2
version=${3:-$prev_version}
check_prep
if ! has_review_started $name; then
warn "review for '$name' not started"
fi
msgid="$(get_review_msgid $name)"
tmpdir="$(get_temp_dir)"
cleanup_dir_on_exit $tmpdir
mbox_path=$(retrieve_mbox $name $msgid $tmpdir quiet)
if [[ -n "$version" ]]; then
curr_version=$version
else
curr_version="$(get_latest_revision ${mbox_path})"
fi
if [[ ${curr_version} -eq 1 ]]; then
error "v1, nothing to diff against"
fi
if [[ -z "$prev_version" ]]; then
prev_version=$((${curr_version} - 1))
fi
review_range_diff $name $name ${mbox_path} ${mbox_path} $tmpdir ${prev_version} ${curr_version}