summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.mk.in3
-rw-r--r--plugins/comments/bin/commit.sh1
-rw-r--r--plugins/comments/bin/print.sh28
-rw-r--r--plugins/comments/bin/showcomment.sh27
-rw-r--r--plugins/date.author/bin/commit.sh28
-rw-r--r--plugins/date.author/info.mk.in5
-rw-r--r--plugins/files/bin/get.d.sh2
-rw-r--r--plugins/files/bin/print.sh39
-rw-r--r--plugins/files/bin/tree.sh40
-rw-r--r--plugins/main.mk.in2
-rw-r--r--plugins/tags/bin/commit.sh1
-rw-r--r--plugins/tags/bin/print.sh30
-rw-r--r--plugins/tree/bin/commit.sh1
-rw-r--r--plugins/tree/bin/getchildren.sh28
-rw-r--r--plugins/tree/bin/getparents.sh27
-rw-r--r--plugins/tree/bin/print.sh27
-rw-r--r--wrapper/rvs.sh21
17 files changed, 293 insertions, 17 deletions
diff --git a/main.mk.in b/main.mk.in
index e3a6c96..cf47a81 100644
--- a/main.mk.in
+++ b/main.mk.in
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
name = @name@
-ver = 0.9
+ver = 0.9-beta1
# Copyright (C) 2009 Luke Shumaker
#
# This program is free software; you can redistribute it and/or
@@ -45,6 +45,7 @@ filelist = \
clean : clean-wrapper clean-plugins
distclean : clean distclean-wrapper distclean-plugins
$(RM) Makefile *.mk
+ $(RM) -r $(name)-$(ver)
install : install-wrapper install-plugins
uninstall :
$(MAKE) uninstall-plugins
diff --git a/plugins/comments/bin/commit.sh b/plugins/comments/bin/commit.sh
index 4ef2c5d..d13d754 100644
--- a/plugins/comments/bin/commit.sh
+++ b/plugins/comments/bin/commit.sh
@@ -21,5 +21,4 @@ if [ "$RVS_LEVEL" = '0' ]; then
id=`cat "$TMPDIR/commit/files"`
"$RVS" comment "$id"
fi
-cat "$TMPDIR/commit/files"
diff --git a/plugins/comments/bin/print.sh b/plugins/comments/bin/print.sh
new file mode 100644
index 0000000..b04a9cc
--- /dev/null
+++ b/plugins/comments/bin/print.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+name='print'
+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 ID"
+id="${1?"$usage"}"
+
+file="$REPO/@ID@/$id"
+if [ -e "$file" ]; then
+ echo "Comment:"
+ sed 's/\(.*\)/ > \1/' "$file"
+fi
+
diff --git a/plugins/comments/bin/showcomment.sh b/plugins/comments/bin/showcomment.sh
new file mode 100644
index 0000000..efbc00a
--- /dev/null
+++ b/plugins/comments/bin/showcomment.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+name='showcomment'
+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 ID"
+id="${1?"$usage"}"
+
+file="$REPO/@ID@/$id"
+if [ -e "$file" ]; then
+ cat "$file"
+fi
+
diff --git a/plugins/date.author/bin/commit.sh b/plugins/date.author/bin/commit.sh
new file mode 100644
index 0000000..c05f77b
--- /dev/null
+++ b/plugins/date.author/bin/commit.sh
@@ -0,0 +1,28 @@
+#!/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"`
+ time=`date +%s`
+ file="$REPO/@ID@/$time"
+ if [ -n "$wch" ]; then
+ "$RVS" addparent "$id" "$wch"
+ fi
+fi
+
diff --git a/plugins/date.author/info.mk.in b/plugins/date.author/info.mk.in
new file mode 100644
index 0000000..66e8d1e
--- /dev/null
+++ b/plugins/date.author/info.mk.in
@@ -0,0 +1,5 @@
+name = date.author
+ver = 0.9
+priority = 4
+depends = >files author
+
diff --git a/plugins/files/bin/get.d.sh b/plugins/files/bin/get.d.sh
index 89bd92a..646e29d 100644
--- a/plugins/files/bin/get.d.sh
+++ b/plugins/files/bin/get.d.sh
@@ -38,7 +38,7 @@ while read line; do
i="`echo "$line" | cut -f4`" # ID
n="`echo "$line" | cut -f5-`" # name
"$RVS" get "$n" "$i"
- #chmod "$p" "$n"
+ chmod "$p" "$n"
#chown "$o:$g" "$n"
done < "$tmp"
diff --git a/plugins/files/bin/print.sh b/plugins/files/bin/print.sh
new file mode 100644
index 0000000..3657d2f
--- /dev/null
+++ b/plugins/files/bin/print.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+name='print'
+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='ID'
+id="`getvar "$1"`"
+
+hash="`"$RVS" blob-gethash "$id"`"
+file="$REPO/@ID@/$hash"
+
+if [ -e "$file" ]; then
+ t="`"$RVS" blob-gettype "$id"`"
+ type=''
+ case "$t" in
+ f) type='regular file';;
+ d) type='directory';;
+ esac
+ echo "File Type: $t ($type)"
+else
+ fatal "no object with ID \`$id'"
+fi
+
diff --git a/plugins/files/bin/tree.sh b/plugins/files/bin/tree.sh
new file mode 100644
index 0000000..6164d94
--- /dev/null
+++ b/plugins/files/bin/tree.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+name='tree'
+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 [NAME] [PREFIX] [LAST]"
+id="`getvar "$1"`"
+name="${2-.}"
+pref="$3"
+last="$4"
+
+echo "$pref $name $id"
+pref=' | '
+"$RVS" ls "$id" '%i\t%n' | while read line; do
+ i="`echo "$line" | cut -f1`"
+ n="`echo "$line" | cut -f2-`"
+ t="`"$RVS" blob-gettype "$i"`"
+ if [ "$t" = 'd' ]
+ "$RVS" tree "$i" "$n" "$pref"
+ else
+ echo "$pref $n $i"
+ fi
+done
+
diff --git a/plugins/main.mk.in b/plugins/main.mk.in
index 677ffe6..774e4ac 100644
--- a/plugins/main.mk.in
+++ b/plugins/main.mk.in
@@ -24,7 +24,7 @@ LIBDIR = @LIBDIR@
ETCDIR = @ETCDIR@
dirs += $(sysconfdir) $(BINDIR) $(TMPDIR) $(LIBDIR) $(ETCDIR)
-mods = $(patsubst ./%,%,$(shell find ./* -maxdepth 0 -type d))
+mods = files tags
mods-build = $(addprefix build-,$(mods))
mods-install = $(addprefix install-,$(mods))
mods-uninstall = $(addprefix uninstall-,$(mods))
diff --git a/plugins/tags/bin/commit.sh b/plugins/tags/bin/commit.sh
index 3d37ed5..9282a11 100644
--- a/plugins/tags/bin/commit.sh
+++ b/plugins/tags/bin/commit.sh
@@ -21,5 +21,4 @@ if [ "$RVS_LEVEL" = '0' ]; then
id=`cat "$TMPDIR/commit/files"`
"$RVS" tag "$id" wch
fi
-cat "$TMPDIR/commit/files"
diff --git a/plugins/tags/bin/print.sh b/plugins/tags/bin/print.sh
new file mode 100644
index 0000000..b7bc1c5
--- /dev/null
+++ b/plugins/tags/bin/print.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+name='print'
+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 ID"
+id="${1?"$usage"}"
+
+dir="$REPO/@ID@"
+if [ -d "$dir" ]; then
+ cd "$dir"
+ echo "Tags:"
+ grep -rFxl "$id" ./ | sed 's/^\.\/\(.*\)/ \1/'
+fi
+
+
diff --git a/plugins/tree/bin/commit.sh b/plugins/tree/bin/commit.sh
index f4e6042..89b1bf6 100644
--- a/plugins/tree/bin/commit.sh
+++ b/plugins/tree/bin/commit.sh
@@ -24,5 +24,4 @@ if [ "$RVS_LEVEL" = '0' ]; then
"$RVS" addparent "$id" "$wch"
fi
fi
-cat "$TMPDIR/commit/files"
diff --git a/plugins/tree/bin/getchildren.sh b/plugins/tree/bin/getchildren.sh
new file mode 100644
index 0000000..952522c
--- /dev/null
+++ b/plugins/tree/bin/getchildren.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+name='getchildren'
+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 ID"
+id="${1?"$usage"}"
+
+dir="$REPO/@ID@/"
+if [ -d "$dir" ]; then
+ grep -rFxh "$id" "$dir"
+fi
+
+
diff --git a/plugins/tree/bin/getparents.sh b/plugins/tree/bin/getparents.sh
new file mode 100644
index 0000000..6e3edbd
--- /dev/null
+++ b/plugins/tree/bin/getparents.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+name='getparents'
+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 ID"
+id="${1?"$usage"}"
+
+dir="$REPO/@ID@/$id"
+if [ -d "$dir" ]; then
+ cat "$dir"/*
+fi
+
diff --git a/plugins/tree/bin/print.sh b/plugins/tree/bin/print.sh
new file mode 100644
index 0000000..0ebf8fd
--- /dev/null
+++ b/plugins/tree/bin/print.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+name='print'
+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 ID"
+id="${1?"$usage"}"
+
+echo "Parents:"
+"$RVS" getparents "$id" | sed 's/\(.*\)/ \1/'
+echo "Children:"
+"$RVS" getchildren "$id" | sed 's/\(.*\)/ \1/'
+
diff --git a/wrapper/rvs.sh b/wrapper/rvs.sh
index c2e3594..101268f 100644
--- a/wrapper/rvs.sh
+++ b/wrapper/rvs.sh
@@ -18,11 +18,11 @@ ver='0.9'
# along with this program; see the file COPYING.
# If not, see <http://www.gnu.org/licenses>.
-export RVS="$0" #RVS="@RVS@"
- BINDIR="@BINDIR@"
- baseTMPDIR="@TMPDIR@"
-export LIBDIR="@LIBDIR@"
-export ETCDIR="@ETCDIR@"
+export RVS="$0" #RVS='@RVS@'
+ BINDIR='@BINDIR@'
+ baseTMPDIR='@TMPDIR@'
+export LIBDIR='@LIBDIR@'
+export ETCDIR='@ETCDIR@'
################################################################################
# Internal use #
@@ -75,7 +75,7 @@ _runcom() {
exit 1
else
mkdir -p "$baseTMPDIR"
- export TMPDIR=`mktemp -d --tmpdir="$baseTMPDIR"`
+ export TMPDIR="`mktemp -d --tmpdir="$baseTMPDIR"`"
if [ -z "$RVS_LEVEL" ]; then
export RVS_LEVEL=0;
@@ -88,10 +88,9 @@ _runcom() {
elif [ -d "$BINDIR/$command" ]; then
mkdir -p "$TMPDIR/$command"
for file in "$BINDIR/$command"/*; do
- id=`basename "$file" | sed 's/^[0-9]*-//'`
- "$file" $@ > "$TMPDIR/$command/$id"
+ id="`basename "$file" | sed 's/^[0-9]*-//'`"
+ "$file" $@ | tee "$TMPDIR/$command/$id"
done
- cat "$TMPDIR/$command/$id"
else
exit 2
fi
@@ -103,7 +102,7 @@ _nextpriority() {
usage="usage: $RVS nextpriority COMMAND"
command=${1?"$usage"}
for file in "$BINDIR/$command"/*; do
- echo $file | sed 's/^\([0-9]*\)-.*/\1/'
+ echo "$file" | sed 's/^\([0-9]*\)-.*/\1/'
done | sort -n | tail -n1 | xargs expr 1 +
}
@@ -116,7 +115,7 @@ _init() {
# 0 - fine
# 1 - repo already exists
# 2 - error running init commands
- REPO=`_repo 2> /dev/null`
+ REPO="`_repo 2> /dev/null`"
if [ -z "$REPO" ]; then
export REPO="`pwd`/.$name"
install -d "$REPO"