forked from matschaffer/profile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
svn.conf
69 lines (54 loc) · 2 KB
/
svn.conf
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
shopt -s extglob progcomp
source $PROFILE_PATH/scripts/svn-completion.sh
svn_remove_unversioned() {
svn st | grep -e "^\?" | nth_field 2 | xargs rm -rf
}
svn_list_siblings() {
local base siblings sibling
base=`svn info | grep URL | nth_field 2 | xargs dirname`
siblings=`svn ls ${base}`
for sibling in ${siblings}; do
echo ${base}/${sibling}
done
}
svn_review_branch() {
local low_rev
low_rev=`svn log -q --stop-on-copy "$1" | ruby -e "puts STDIN.read.scan(/r(\d+)/).last"`
svn diff --diff-cmd diff -x -uw -r${low_rev}:HEAD > changes.diff
echo "--This line, and those below, will be ignored--" > changes.summary
svn diff --summarize -r${low_rev}:HEAD >> changes.summary
}
svn_integrate_branch() {
local log merge_line low_rev high_rev message
log=`svn log --stop-on-copy`
if echo "${log}" | grep "Integrating $1" > /dev/null; then
merge_line=`echo "${log}" | grep "$1" | grep "svn merge"`
low_rev=`echo ${merge_line} | cut -d: -f2 | cut -d' ' -f1`
echo "Found previous integration of $1 up to revision ${low_rev}"
else
low_rev=`svn log -q --stop-on-copy "$1" | ruby -e "puts STDIN.read.scan(/r(\d+)/).last"`
echo "Performing full branch integration starting at ${low_rev}"
fi
high_rev=`svn info "$1" | ruby -e "puts STDIN.read.match(/Revision: (\d+)/)[1]"`
svn merge --non-interactive --ignore-ancestry -r${low_rev}:${high_rev} "$1"
conflicts=`svn st | ruby -e 'puts STDIN.read.scan(/^\s*C\s+(.*)/).join("\n")' | awk '{print " "$0}'`
cat > svn-commit.tmp <<EOS
Integrating $1:
svn merge --ignore-ancestry -r${low_rev}:${high_rev} "$1"
Conflicts on:
$conflicts
Rally task: N/A
QC ticket: N/A
New features: None
Modified features: None
Pages affected: None
EOS
svn log -r$(($low_rev + 1)):${high_rev} "$1" | awk '{print " "$0}' >> svn-commit.tmp
# svn ci -F svn-commit.tmp
}
svn_deprecate() {
local attic
attic="`dirname $1`/Attic"
svn ls "${attic}" 2>&1 > /dev/null || (echo "Creating folder ${attic}..." && svn mkdir "${attic}")
svn mv "$1" "${attic}"
}