Open GoogleCodeExporter opened 8 years ago
How about this little ditty — it works on multiple WCs & folders of WCs (or
sym-links to WCs) and actually can show updates for WCs.
> svn_wcs --help
Summarise status of Subversion working copies.
Usage: svn_wcs [options] [directories…]
-u [--show-updates] : get update info from repository
-v [--ignore-unversioned] : don’t show info for unversioned files
-x [--ignore-externals] : ignore externals definitions
-wc [--working-copies] : directories are working copies
[directories…] : WCs or directories containing WCs
If no directory is specified then . is used.
----->8----->8----->8----->8----->8----->8----->8-----
#!/bin/bash -e
# Summarise status of Subversion Working Copies
# Usage: svn_wcs [--show-updates] [--ignore-unversioned] [--ignore-externals]
[-wc] [dir…]
opts=; col1='[^ ]'
case "$1" in -h|--help) echo "Summarise status of Subversion working copies.
Usage: ${0##*/} [options] [directories…]
-u [--show-updates] : get update info from repository
-v [--ignore-unversioned] : don’t show info for unversioned files
-x [--ignore-externals] : ignore externals definitions
-wc [--working-copies] : directories are working copies
[directories…] : WCs or directories containing WCs
If no directory is specified then . is used."; exit;; esac
case "$1" in -u|--show-updates) opts='--show-updates'; shift;; esac
case "$1" in -v|--ignore-unversioned) col1='[^ \?]'; shift;; esac
case "$1" in -x|--ignore-externals) opts+=' --ignore-externals'; shift;; esac
case "$1" in -wc|--working-copies) wc=1; shift;; esac
if [ $# = 0 ]; then set -- .; fi
function Stat() {
local w="$PWD"
for d in "$@"; do cd "$w"
if [ -d "$d" ]; then
cd "$d"; rev=`svnversion || echo 'exported'`
if [ "$rev" != exported ]; then
if [ ${#PWD} -gt $L ]; then L=${#PWD}; fi
if [ ${#rev} -gt $R ]; then R=${#rev}; fi
dirs[i]="$PWD"
revs[$((i++))]="$rev"
fi
fi
done
}
dirs=; revs=; i=0; L=8; R=3; S=' '; S="$S$S$S$S"; S="$S$S$S$S$S"
if [ "$wc" ]
then Stat "$@"
else d0="$PWD"; for r in "$@"; do cd "$d0"; cd "$r"; Stat *; done
fi 2> /dev/null
Sed="s/^($col1)...... .*/\1/p"$'\ns/^.([^ ])..... .*/\\1/p\n/^........\\*
/i\\\n*'
i=0; for dir in ${dirs[*]}; do
cd "$dir"; rev="${revs[$((i++))]}"
st=`svn st --non-interactive $up | sed -Ene "$Sed" | sort -r | uniq | tr -d '\n'`
printf "%s%s r%s%s %s\n" "$dir" "${S::$((L-${#dir}))}" \
$rev "${S::$((R-${#rev}))}" "${st:-✓}"
done 2> /dev/null
----->8----->8----->8----->8----->8----->8----->8-----
Original comment by chris...@gmail.com
on 1 Mar 2012 at 2:30
Certainly. Much nicer too.
Thus: it appears to be relatively easy to get the desired information. Now all
that is needed is a column in the working copies window that shows this
information.
Original comment by mikael.s...@gmail.com
on 1 Mar 2012 at 9:02
Original issue reported on code.google.com by
mikael.s...@gmail.com
on 20 Jan 2012 at 12:32