summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rvs/plugins/comments/bin/comment.sh14
-rw-r--r--rvs/plugins/comments/bin/commit.sh5
-rw-r--r--rvs/plugins/comments/info.mk.in2
-rw-r--r--rvs/plugins/files/bin/blob-gethash.sh26
-rw-r--r--rvs/plugins/files/bin/blob-gettype.sh26
-rw-r--r--rvs/plugins/files/bin/commit.d.sh20
-rw-r--r--rvs/plugins/files/bin/commit.f.sh11
-rw-r--r--rvs/plugins/files/bin/commit.sh6
-rw-r--r--rvs/plugins/files/bin/file-gettype.sh (renamed from rvs/plugins/files/bin/gettype.sh)6
-rw-r--r--rvs/plugins/files/bin/get.d.sh23
-rw-r--r--rvs/plugins/files/bin/get.f.sh12
-rw-r--r--rvs/plugins/files/bin/get.sh16
-rw-r--r--rvs/plugins/files/bin/ls.sh50
-rw-r--r--rvs/plugins/files/info.mk.in2
-rw-r--r--rvs/plugins/files/lib/stdio.sh18
-rw-r--r--rvs/plugins/tags/bin/commit.sh25
-rw-r--r--rvs/plugins/tags/info.mk.in4
-rw-r--r--rvs/plugins/tree/bin/addparent.d.sh44
-rw-r--r--rvs/plugins/tree/bin/addparent.f.sh27
-rw-r--r--rvs/plugins/tree/bin/addparent.sh32
-rw-r--r--rvs/plugins/tree/bin/delparent.f.sh34
-rw-r--r--rvs/plugins/tree/info.mk.in5
-rw-r--r--rvs/wrapper/rvs.sh4
23 files changed, 356 insertions, 56 deletions
diff --git a/rvs/plugins/comments/bin/comment.sh b/rvs/plugins/comments/bin/comment.sh
index fbe5689..0be99e5 100644
--- a/rvs/plugins/comments/bin/comment.sh
+++ b/rvs/plugins/comments/bin/comment.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-name='rvs @ID@ commit'
+name='comment'
ver=0.1
-# Copyright (C) 2009-2010 Luke Shumaker
+# Copyright (C) 2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,8 +17,10 @@ ver=0.1
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-if [ "$RVS_LEVEL" = '0' ]; then
- id=`cat $TMPDIR/commit/files`
- "$RVS" tag "$id" wch
-fi
+usage="usage: $RVS $name ID"
+id="${1?"$usage"}"
+
+file="$REPO/@ID@/$id"
+mkdir -p "`dirname "$file"`"
+editor "$file" >> /dev/stderr
diff --git a/rvs/plugins/comments/bin/commit.sh b/rvs/plugins/comments/bin/commit.sh
index 7a6e619..4ef2c5d 100644
--- a/rvs/plugins/comments/bin/commit.sh
+++ b/rvs/plugins/comments/bin/commit.sh
@@ -1,7 +1,7 @@
#!/bin/sh
name='rvs @ID@ commit'
ver=0.1
-# Copyright (C) 2009-2010 Luke Shumaker
+# Copyright (C) 2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -18,7 +18,8 @@ ver=0.1
# If not, see <http://www.gnu.org/licenses>.
if [ "$RVS_LEVEL" = '0' ]; then
- id=`cat $TMPDIR/commit/files`
+ id=`cat "$TMPDIR/commit/files"`
"$RVS" comment "$id"
fi
+cat "$TMPDIR/commit/files"
diff --git a/rvs/plugins/comments/info.mk.in b/rvs/plugins/comments/info.mk.in
index 7aa15d1..144b832 100644
--- a/rvs/plugins/comments/info.mk.in
+++ b/rvs/plugins/comments/info.mk.in
@@ -1,3 +1,5 @@
name = comments
ver = 0.1
priority = 1
+depends = >files
+
diff --git a/rvs/plugins/files/bin/blob-gethash.sh b/rvs/plugins/files/bin/blob-gethash.sh
new file mode 100644
index 0000000..b790d28
--- /dev/null
+++ b/rvs/plugins/files/bin/blob-gethash.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+name='blob-gethash'
+ver=0.9
+# Copyright (C) 2009-2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+. "$LIBDIR/@ID@/stdio"
+
+usage="ID"
+id="`getvar "$1"`"
+
+echo $id | sed 's:.*/::'
+
diff --git a/rvs/plugins/files/bin/blob-gettype.sh b/rvs/plugins/files/bin/blob-gettype.sh
new file mode 100644
index 0000000..3378506
--- /dev/null
+++ b/rvs/plugins/files/bin/blob-gettype.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+name='blob-gettype'
+ver=0.9
+# Copyright (C) 2009-2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+. "$LIBDIR/@ID@/stdio"
+
+usage="ID"
+id="`getvar "$1"`"
+
+echo $id | sed 's:/.*::'
+
diff --git a/rvs/plugins/files/bin/commit.d.sh b/rvs/plugins/files/bin/commit.d.sh
index 0da1efb..d7e48f9 100644
--- a/rvs/plugins/files/bin/commit.d.sh
+++ b/rvs/plugins/files/bin/commit.d.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-name='rvs files commit.d'
+name='commit.d'
ver=0.9
-# Copyright (C) 2009 Luke Shumaker
+# Copyright (C) 2009-2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -19,14 +19,22 @@ ver=0.9
. "$LIBDIR/@ID@/stdio"
-# commit.d DIRNAME
-dir="${1?'usage: commit.d DIRNAME'}"
+usage="DIRNAME"
+dir="`getvar "$1"`"
+
tmp=`mktemp`
+t=' ';
cd "$dir"
for file in *; do
- id=`"$RVS" commit "$file"`
- echo "$file:$id" >> "$tmp"
+ p="`stat "$file" -c'%a' `" # permissions
+ o="`stat "$file" -c'%u (%U)'`" # owner
+ g="`stat "$file" -c'%g (%G)'`" # group
+ i="`"$RVS" commit "$file"`" # ID
+ n="$file" # name
+
+ # %p %o %g %i %n
+ echo "$p$t$o$t$g$t$i$t$n" >> "$tmp"
done
"$RVS" commit.f "$tmp" d
diff --git a/rvs/plugins/files/bin/commit.f.sh b/rvs/plugins/files/bin/commit.f.sh
index 17de155..c27005b 100644
--- a/rvs/plugins/files/bin/commit.f.sh
+++ b/rvs/plugins/files/bin/commit.f.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-name='rvs files commit.f'
+name='commit.f'
ver=0.9
-# Copyright (C) 2009 Luke Shumaker
+# Copyright (C) 2009-2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,11 +17,10 @@ ver=0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-#. "$LIBDIR/@ID@/stdio"
+. "$LIBDIR/@ID@/stdio"
-# commit.f FILENAME
-usage="usage: $RVS commit.f FILENAME [PREFIX]"
-file="${1?"$usage"}"
+usage="FILENAME [PREFIX]"
+file="`getvar "$1"`"
prefix="${2-f}"
hash=`sha1sum $file | sed "s/ .*$//"`
diff --git a/rvs/plugins/files/bin/commit.sh b/rvs/plugins/files/bin/commit.sh
index e8db1eb..0bb8233 100644
--- a/rvs/plugins/files/bin/commit.sh
+++ b/rvs/plugins/files/bin/commit.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-name='rvs filecontent commit'
+name='commit'
ver=0.9
# Copyright (C) 2009-2010 Luke Shumaker
#
@@ -19,9 +19,9 @@ ver=0.9
. "$LIBDIR/@ID@/stdio"
-# commit FILE
+usage="[FILE]"
file=${1-.} # take arg1 as the file, default to the current directory
-type=`"$RVS" gettype "$file"`
+type=`"$RVS" file-gettype "$file"`
"$RVS" "commit.$type" "$file"
diff --git a/rvs/plugins/files/bin/gettype.sh b/rvs/plugins/files/bin/file-gettype.sh
index 84eb9da..2a1e0ca 100644
--- a/rvs/plugins/files/bin/gettype.sh
+++ b/rvs/plugins/files/bin/file-gettype.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-name='rvs @ID@ gettype'
+name='file-gettype'
ver=0.9
# Copyright (C) 2009-2010 Luke Shumaker
#
@@ -19,8 +19,8 @@ ver=0.9
. "$LIBDIR/@ID@/stdio"
-usage="usage: $RVS gettype FILE"
-file=${1?"$usage"}
+usage="FILE"
+file="`getvar "$1"`"
if [ ! -e "$file" ]; then
fatal "file \`$file' does not exist";
diff --git a/rvs/plugins/files/bin/get.d.sh b/rvs/plugins/files/bin/get.d.sh
index 1a001d3..89bd92a 100644
--- a/rvs/plugins/files/bin/get.d.sh
+++ b/rvs/plugins/files/bin/get.d.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-name='rvs files get.d'
+name='get.d'
ver=0.9
-# Copyright (C) 2009 Luke Shumaker
+# Copyright (C) 2009-2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,11 +17,11 @@ ver=0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-#. "$LIBDIR/@ID@/stdio"
+. "$LIBDIR/@ID@/stdio"
-usage="usage: $RVS get.d DIRNAME ID"
-dir="${1?"$usage"}"
- id="${2?"$usage"}"
+usage="DIRNAME ID"
+dir="`getvar "$1"`"
+ id="`getvar "$2"`"
tmp=`mktemp`
"$RVS" get.f "$tmp" "$id"
@@ -32,9 +32,14 @@ mkdir -p "$dir"
cd "$dir"
rm -rf ./*
while read line; do
- _id="`echo "$line" | sed 's/^.*://'`"
- _name="`echo "$line" | sed 's@:'"$_id"'$@@'`"
- "$RVS" get "$_name" "$_id"
+ p="`echo "$line" | cut -f1`" # permissions
+ o="`echo "$line" | cut -f2`" # owner
+ g="`echo "$line" | cut -f3`" # group
+ i="`echo "$line" | cut -f4`" # ID
+ n="`echo "$line" | cut -f5-`" # name
+ "$RVS" get "$n" "$i"
+ #chmod "$p" "$n"
+ #chown "$o:$g" "$n"
done < "$tmp"
rm "$tmp"
diff --git a/rvs/plugins/files/bin/get.f.sh b/rvs/plugins/files/bin/get.f.sh
index b137911..00508ab 100644
--- a/rvs/plugins/files/bin/get.f.sh
+++ b/rvs/plugins/files/bin/get.f.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-name='rvs files get.f'
+name='get.f'
ver=0.9
-# Copyright (C) 2009 Luke Shumaker
+# Copyright (C) 2009-2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,11 +17,11 @@ ver=0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-#. "$LIBDIR/@ID@/stdio"
+. "$LIBDIR/@ID@/stdio"
-usage="usage: $RVS get.f FILENAME ID"
-name="${1?"$usage"}"
- id="${2?"$usage"}"
+usage="FILENAME ID"
+name="`getvar "$1"`"
+ id="`getvar "$2"`"
install -T "$REPO/@ID@/$id" "$name"
diff --git a/rvs/plugins/files/bin/get.sh b/rvs/plugins/files/bin/get.sh
index d3f046c..639ac57 100644
--- a/rvs/plugins/files/bin/get.sh
+++ b/rvs/plugins/files/bin/get.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-name='rvs filecontent get'
+name='get'
ver=0.9
-# Copyright (C) 2009 Luke Shumaker
+# Copyright (C) 2009-2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,16 +17,16 @@ ver=0.9
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-#. "$LIBDIR/@ID@/stdio"
+. "$LIBDIR/@ID@/stdio"
-usage="usage: $RVS get FILENAME ID"
-name="${1?"$usage"}"
- id="${2?"$usage"}"
+usage="FILENAME ID"
+name="`getvar "$1"`"
+ id="`getvar "$2"`"
file="$REPO/@ID@/$id"
-type="`echo $id | sed 's:/.*::'`"
-#hash="`echo $id | sed 's:.*/::'`"
+type="`"$RVS" blob-gettype "$id"`"
+#hash="`"$RVS" blob-gethash "$id"`"
"$RVS" "get.$type" "$name" "$id"
diff --git a/rvs/plugins/files/bin/ls.sh b/rvs/plugins/files/bin/ls.sh
new file mode 100644
index 0000000..ae225cf
--- /dev/null
+++ b/rvs/plugins/files/bin/ls.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+name='ls'
+ver=0.1
+# Copyright (C) 2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+. "$LIBDIR/@ID@/stdio"
+
+usage="DIR_ID [FORMAT]"
+id="`getvar "$1"`"
+form="${2-%p\t%o\t%g\t%n\t%i}"
+
+# %p - permissions
+# %o - owner
+# %g - group
+# %i - blob id
+# %n - name
+# \t - a tab char
+
+tmp="`mktemp`"
+"$RVS" get.f "$tmp" "$id"
+
+while read line; do
+ p="`echo "$line" | cut -f1`"
+ o="`echo "$line" | cut -f2`"
+ g="`echo "$line" | cut -f3`"
+ i="`echo "$line" | cut -f4`"
+ n="`echo "$line" | cut -f5-`"
+ echo "$form" | sed \
+ -e 's:\\t:\t:g' \
+ -e "s:%p:${p/':'/'\:'}:g" \
+ -e "s:%o:${o/':'/'\:'}:g" \
+ -e "s:%g:${g/':'/'\:'}:g" \
+ -e "s:%i:${i/':'/'\:'}:g" \
+ -e "s:%n:${n/':'/'\:'}:g"
+done < "$tmp"
+
diff --git a/rvs/plugins/files/info.mk.in b/rvs/plugins/files/info.mk.in
index 7552306..fac7862 100644
--- a/rvs/plugins/files/info.mk.in
+++ b/rvs/plugins/files/info.mk.in
@@ -1,3 +1,5 @@
name = files
ver = 0.9
priority = 0
+depends =
+
diff --git a/rvs/plugins/files/lib/stdio.sh b/rvs/plugins/files/lib/stdio.sh
index 09d2ec7..974e98e 100644
--- a/rvs/plugins/files/lib/stdio.sh
+++ b/rvs/plugins/files/lib/stdio.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-#name='rvs @ID@ stdio'
+#name='stdio'
#ver=0.9
-# Copyright (C) 2009 Luke Shumaker
+# Copyright (C) 2009-2010 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -41,18 +41,26 @@ fatal () {
error() {
warn "$1"
cat << __error__ >> /dev/stderr
-Usage: $name $usage
+Usage: $RVS $name $usage
-Try \`$name --help' for more options.
+Try \`$RVS help $name' for more options.
__error__
exit 1
}
+getvar() {
+ if [ -z "$1" ]; then
+ error
+ else
+ echo $1
+ fi
+}
+
version() {
echo "$name $ver"
if [ "$volume" != '-q' ]; then
cat << __disclaimer__
-$name is copyright (C) 2009 Luke Shumaker
+$name is copyright (C) 2009-2010 Luke Shumaker
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
diff --git a/rvs/plugins/tags/bin/commit.sh b/rvs/plugins/tags/bin/commit.sh
index e69de29..3d37ed5 100644
--- a/rvs/plugins/tags/bin/commit.sh
+++ b/rvs/plugins/tags/bin/commit.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+name='rvs @ID@ commit'
+ver=0.1
+# Copyright (C) 2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+if [ "$RVS_LEVEL" = '0' ]; then
+ id=`cat "$TMPDIR/commit/files"`
+ "$RVS" tag "$id" wch
+fi
+cat "$TMPDIR/commit/files"
+
diff --git a/rvs/plugins/tags/info.mk.in b/rvs/plugins/tags/info.mk.in
index 1828b51..9a6ba49 100644
--- a/rvs/plugins/tags/info.mk.in
+++ b/rvs/plugins/tags/info.mk.in
@@ -1,3 +1,5 @@
name = tags
ver = 0.1
-priority = 2
+priority = 3
+depends = >files
+
diff --git a/rvs/plugins/tree/bin/addparent.d.sh b/rvs/plugins/tree/bin/addparent.d.sh
new file mode 100644
index 0000000..ed21085
--- /dev/null
+++ b/rvs/plugins/tree/bin/addparent.d.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+name='addparent.d'
+ver=0.1
+# Copyright (C) 2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+usage="usage: $RVS $name CHILD PARENT"
+ child=${1?"$usage"}
+parent=${2?"$usage"}
+
+tc="`mktemp`"
+tp="`mktemp`"
+
+"$RVS" ls "$child" '%n %i' > "$tc"
+"$RVS" ls "$parent" '%n %i' > "$tc"
+
+while read line; do
+ name="`echo "$line" | sed 's:\t[a-z]/[0-9a-f]$::'`"
+ nID="`echo "$line" | sed 's:^.*\t::'`"
+ oID="`sed -n 's:^${name/':'/'\:'}\t\([a-z]/[0-9a-f]\)$:\1:p'`"
+
+ if [ -n "$oID" ] {
+ nT="`"$RVS" blob-gettype "$nID"`"
+ oT="`"$RVS" blob-gettype "$oID"`"
+ if [ "$nT" = "$oT" ]; then
+ "$RVS" addparent "$nID" "$oID"
+ fi
+ }
+done < "$tc"
+
+"$RVS" addparent.f "$child" "$parent"
diff --git a/rvs/plugins/tree/bin/addparent.f.sh b/rvs/plugins/tree/bin/addparent.f.sh
new file mode 100644
index 0000000..61b4f92
--- /dev/null
+++ b/rvs/plugins/tree/bin/addparent.f.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+name='addparent.f'
+ver=0.1
+# Copyright (C) 2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+usage="usage: $RVS $name CHILD PARENT"
+ child=${1?"$usage"}
+parent=${2?"$usage"}
+
+file="$REPO/tree/$child/$parent"
+mkdir -p "`dirname "$file"`"
+echo "$parent" > "$file"
+
diff --git a/rvs/plugins/tree/bin/addparent.sh b/rvs/plugins/tree/bin/addparent.sh
new file mode 100644
index 0000000..af60e5a
--- /dev/null
+++ b/rvs/plugins/tree/bin/addparent.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+name='addparent'
+ver=0.1
+# Copyright (C) 2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+usage="usage: $RVS $name CHILD PARENT"
+ child=${1?"$usage"}
+parent=${2?"$usage"}
+
+ct="`"$RVS" blob-gettype "$child"`"
+pt="`"$RVS" blob-gettype "$parent"`"
+
+if [ "$ct" = "$pt" ]; then
+ "$RVS" "addparent.$ct" "$child" "$parent"
+else
+ error "CHILD and PARENT must be type of the same type"
+fi
+
diff --git a/rvs/plugins/tree/bin/delparent.f.sh b/rvs/plugins/tree/bin/delparent.f.sh
new file mode 100644
index 0000000..e53df9b
--- /dev/null
+++ b/rvs/plugins/tree/bin/delparent.f.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+name='delparent.f'
+ver=0.1
+# Copyright (C) 2010 Luke Shumaker
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING.
+# If not, see <http://www.gnu.org/licenses>.
+
+usage="usage: $RVS $name CHILD PARENT"
+ child=${1?"$usage"}
+parent=${2?"$usage"}
+
+file="$REPO/tree/$child/$parent"
+rm "$file"
+if [ -z "$(ls "`dirname "$file"`")" ]; then
+ rmdir "`dirname "$file"`"
+fi
+
+ dir="$REPO/tree/$child"
+if [ -z "$(ls "`dirname "$dir"`")" ]; then
+ rmdir "`dirname "$dir"`"
+fi
+
diff --git a/rvs/plugins/tree/info.mk.in b/rvs/plugins/tree/info.mk.in
new file mode 100644
index 0000000..be9bc3b
--- /dev/null
+++ b/rvs/plugins/tree/info.mk.in
@@ -0,0 +1,5 @@
+name = tree
+ver = 0.1
+priority = 1
+depends = >files <tags
+
diff --git a/rvs/wrapper/rvs.sh b/rvs/wrapper/rvs.sh
index e2e94e6..c2e3594 100644
--- a/rvs/wrapper/rvs.sh
+++ b/rvs/wrapper/rvs.sh
@@ -56,6 +56,8 @@ _repo() {
_error "no $name repository found"
fi
cd "$owd"
+ else
+ echo "$REPO"
fi
}
@@ -75,7 +77,7 @@ _runcom() {
mkdir -p "$baseTMPDIR"
export TMPDIR=`mktemp -d --tmpdir="$baseTMPDIR"`
- if [ -z "RVS_LEVEL" ]; then
+ if [ -z "$RVS_LEVEL" ]; then
export RVS_LEVEL=0;
else
export RVS_LEVEL=`expr $RVS_LEVEL + 1`