-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvdm.in
82 lines (62 loc) · 2.21 KB
/
vdm.in
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
77
78
79
80
81
82
#!/bin/sh
#
# Vendor Drop Merge
# TIP: ./vdm 2>&1 | tee vdm.log
#
@LICENSE@
set -eux
. ./vdm.conf
previous_tag_file='.vdm_previous_tag'
previous_tag_file_legacy='.svn_previous_tag'
svn_load_dirs='bin/svn_load_dirs'
# Migrate from older vdm versions
test -f "$previous_tag_file_legacy" -a ! -f "$previous_tag_file" && mv "$previous_tag_file_legacy" "$previous_tag_file"
previous_tag=$(cat "$previous_tag_file")
becho () {
set +x
echo
echo ---------------------------------------------------------------------------
echo "* $1"
echo ---------------------------------------------------------------------------
echo
set -x
}
becho 'Updating upstream wc'
# Migrate from cvsup-based upstream
test -d "${upstream_wc}/sup" && rm -rf "$upstream_wc"
if [ -d "${upstream_wc}/.svn" ]; then
if [ "$(svn info "$upstream_wc" | awk '/^URL: / { print $2 }')" = "$upstream_uri" ]; then
svn up "$upstream_wc"
else
svn switch "$upstream_uri" "$upstream_wc"
fi
else
svn co "$upstream_uri" "$upstream_wc"
fi
tag="${vendor_drop_path}-$(date -u +%Y%m%d%H%M%S)-r$(svn info "$upstream_wc" | awk '/^Last Changed Rev: / { print $4 }')"
becho 'Importing vendor drop'
env TMPDIR="$(pwd)" \
"$svn_load_dirs" -no_user_input -t "$tag" \
-glob_ignores '' \
"${svnroot_uri}/vendor/${project_root_path}" \
"$vendor_drop_path" "$upstream_wc"
becho "Updating project wc"
if [ -d "$project_wc" ]; then
if [ "$(svn info "$project_wc" | awk '/^URL: / { print $2 }')" = "${svnroot_uri}/${project_root_path}/${project_branch_path}" ]; then
svn up "$project_wc"
else
svn switch "${svnroot_uri}/${project_root_path}/${project_branch_path}" "$project_wc"
fi
else
svn co "${svnroot_uri}/${project_root_path}/${project_branch_path}" "$project_wc"
fi
echo "$tag" > "$previous_tag_file"
becho 'Merging vendor drop'
svn merge "${svnroot_uri}/vendor/${project_root_path}/${previous_tag}" \
"${svnroot_uri}/vendor/${project_root_path}/${tag}" \
"${project_wc}/${project_vendor_merge_path}"
becho 'Committing merge'
svn commit -m"Vendor drop merge $previous_tag - $tag to $project_branch_path" \
"${project_wc}/${project_vendor_merge_path}"
becho 'Vendor drop merge complete'
exit