#!/bin/rc fn usage { echo 'usage: vcs/init directory' >[1=2] echo ' directory: root repository directory to initialize' >[1=2] exit 0 } fn f { du -a $* | sed 's/^.* //g' } # # For (as yet) nonexistent $changelog and others # #if(test -e $home/lib/vcsconfig) { # . $home/lib/vcsconfig #} if (! ~ $#* 1) { usage } if (! test -d $1) { usage } initdir=$*(1) pwd=`{pwd} rootpath=$pwd/$initdir for (i in `{f $initdir}) { if (test -d $i) { echo Setting up vcs structure in $i... mkdir $i/.vcs echo $rootpath > $i/.vcs/root } } mkdir $rootpath/.commits echo 0 > $rootpath/.commits/.N touch $rootpath/.lock chmod +l $rootpath/.lock