Mercurial > hg > buildtools
comparison hg2cl @ 4:f27514832835
Test for existence of repository.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 09 May 2008 14:33:35 +0300 |
parents | 4cf32ca7b15e |
children | 8f11993b361d |
comparison
equal
deleted
inserted
replaced
3:407ddf6cd676 | 4:f27514832835 |
---|---|
110 exit 1 | 110 exit 1 |
111 ;; | 111 ;; |
112 esac | 112 esac |
113 done | 113 done |
114 | 114 |
115 # test for repository | |
116 if test ! -e ".hg"; then | |
117 echo "No Mercurial repository found from this directory." | |
118 exit 2 | |
119 fi | |
120 | |
115 # find the directory that this script resides in | 121 # find the directory that this script resides in |
116 prog="$0" | 122 prog="$0" |
117 while test -h "$prog"; do | 123 while test -h "$prog"; do |
118 prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$(dirname "$prog")/,"` | 124 prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$(dirname "$prog")/,"` |
119 done | 125 done |