#!/bin/sh # Determine which, if any, version control system the current directory # is under. # Look in this directory only if [ -d SCCS ]; then echo "sccs"; exit 0; fi if [ -d RCS ]; then echo "rcs"; exit 0; fi if [ -d CVS ]; then echo "cvs"; exit 0; fi if [ -d .svn ]; then echo "svn"; exit 0; fi # Look in parent directories too DIRS="" function updirs { cd $1 cur=`pwd` if [ "x$cur" != "x/" ]; then DIRS="$DIRS $cur" updirs .. fi } updirs . DIRS="$DIRS /" for dir in $DIRS; do cd $dir # $ if [ -d ".git" ]; then echo "git"; exit 0; fi if [ -d ".bzr" ]; then echo "bzr"; exit 0; fi if [ -d ".hg" ]; then echo "hg"; exit 0; fi if [ -d "_darcs" ]; then echo "darcs"; exit 0; fi done echo "unknown" exit 1