forked from ossobv/vcutil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvn-show-mergable
executable file
·34 lines (33 loc) · 1.04 KB
/
svn-show-mergable
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
#!/bin/sh
# svn-show-mergable (part of ossobv/vcutil) // wdoekes/2011 // Public Domain
#
# Shows which revisions are eligible for merging. This is most useful
# when you have a development branch and a live branch and you wish to
# cherry-pick individual commits into the live branch.
#
# It uses the svn:mergeinfo property to read out which revisions are
# still unmerged.
#
# Usage:
#
# svn-show-mergable [PATH_TO_MERGE_SOURCE]
#
# If PATH_OF_MERGE_SOURCE is not supplied, "live-" is stripped from
# the current path. It assumed you're working in ~/src/live-project and
# ~/src/project.
#
# See also:
#
# svn-merge-msg (to use after `svn merge`)
#
sourcepath="$1"
if [ ! -d "$sourcepath" ]; then
if [ -z "$sourcepath" ]; then
sourcepath="../`basename "\`pwd\`" | sed -e 's/^live-//'`"
fi
if [ ! -d "$sourcepath" ]; then
echo "need merge source path as first argument" 2>/dev/null
exit 1
fi
fi
svn log -c `svn mergeinfo --show-revs=eligible $sourcepath | tr '\n' ','` $sourcepath