mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 01:01:27 +00:00
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7352 d57e44dd-8a1f-0410-8b47-8ef2f437770f
55 lines
1.2 KiB
Bash
Executable File
55 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
export LC_ALL=C
|
|
|
|
prefix_matches() {
|
|
local f
|
|
|
|
f="$1"
|
|
shift
|
|
for s in "$@"; do
|
|
if [ "$f" = "$s" ] || [ "${f#s/}" != "$f" ]; then
|
|
return 0
|
|
fi
|
|
done
|
|
return 1
|
|
}
|
|
|
|
for d in "${@-.}"; do
|
|
(
|
|
cd "$d" &&
|
|
if [ -e .svn ]; then
|
|
svn status --no-ignore |
|
|
grep '^[I?] ' |
|
|
cut -c8-
|
|
elif git branch >&/dev/null; then
|
|
exec 3< <(find . -type f | cut -c3- | grep -v '^\.git/' | sort)
|
|
git ls-tree -r HEAD | cut -f2 -d' ' | sort |
|
|
while read -r f; do
|
|
while { read -r g; } <&3 && [ "$g" '<' "$f" ]; do echo "$g"; done
|
|
done
|
|
while { read -r g; } <&3; do echo "$g"; done
|
|
exec 3<&-
|
|
elif hg branch >&/dev/null; then
|
|
subrepos=$(if [ -e .hgsub ]; then sed 's/ = .*//' .hgsub; fi)""
|
|
exec 3< <(find . -type f | cut -c3- | grep -Ev '^$|^\.hg/' | sort)
|
|
hg locate |
|
|
sort |
|
|
while read -r f; do
|
|
while { read -r g; } <&3 && [ "$g" '<' "$f" ]; do
|
|
if ! prefix_matches "$g" "$subrepos"; then
|
|
echo "$g"
|
|
fi
|
|
done
|
|
done
|
|
while { read -r g; } <&3; do echo "$g"; done
|
|
exec 3<&-
|
|
for s in $subrepos; do
|
|
$0 "$s"
|
|
done
|
|
else
|
|
echo "Ignored directory $PWD"
|
|
fi
|
|
)
|
|
done
|