summaryrefslogtreecommitdiff
path: root/modules/tags
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tags')
l---------modules/tags/Makefile1
-rw-r--r--modules/tags/Makefile.inc.mk2
-rw-r--r--modules/tags/Module.mk1
-rw-r--r--modules/tags/commit.sh24
-rw-r--r--modules/tags/get-tag.sh25
-rw-r--r--modules/tags/print.sh30
-rw-r--r--modules/tags/tag-id.sh33
-rw-r--r--modules/tags/tag.sh28
8 files changed, 144 insertions, 0 deletions
diff --git a/modules/tags/Makefile b/modules/tags/Makefile
new file mode 120000
index 0000000..fa7273c
--- /dev/null
+++ b/modules/tags/Makefile
@@ -0,0 +1 @@
+../module.mk \ No newline at end of file
diff --git a/modules/tags/Makefile.inc.mk b/modules/tags/Makefile.inc.mk
new file mode 100644
index 0000000..1ccdada
--- /dev/null
+++ b/modules/tags/Makefile.inc.mk
@@ -0,0 +1,2 @@
+am_src_files += commit.sh get-tag.sh print.sh tag-id.sh tag.sh
+am_out_files += commit get-tag print tag-id tag
diff --git a/modules/tags/Module.mk b/modules/tags/Module.mk
new file mode 100644
index 0000000..30224d0
--- /dev/null
+++ b/modules/tags/Module.mk
@@ -0,0 +1 @@
+tags/commit : blobs/commit tree/commit
diff --git a/modules/tags/commit.sh b/modules/tags/commit.sh
new file mode 100644
index 0000000..d8df1d0
--- /dev/null
+++ b/modules/tags/commit.sh
@@ -0,0 +1,24 @@
+#!/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
+
diff --git a/modules/tags/get-tag.sh b/modules/tags/get-tag.sh
new file mode 100644
index 0000000..27d04da
--- /dev/null
+++ b/modules/tags/get-tag.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+name='rvs @ID@ get-tag'
+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 get-tag FILENAME TAG"
+name="${1?"$usage"}"
+ tag="${2?"$usage"}"
+
+"$RVS" get "$name" "`"$RVS" tag-id "$tag"`"
+
diff --git a/modules/tags/print.sh b/modules/tags/print.sh
new file mode 100644
index 0000000..f9f7a54
--- /dev/null
+++ b/modules/tags/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/modules/tags/tag-id.sh b/modules/tags/tag-id.sh
new file mode 100644
index 0000000..050d12e
--- /dev/null
+++ b/modules/tags/tag-id.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+name='tag-id'
+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 TAG"
+tag="${1?"$usage"}"
+
+file="$REPO/@ID@/$tag"
+
+if [ -f "$file" ]; then
+ cat "$REPO/@ID@/$tag"
+else
+ echo "$0: cannot find tag \`$tag'" >> /dev/stderr
+ exit 1
+fi
+
+
+
diff --git a/modules/tags/tag.sh b/modules/tags/tag.sh
new file mode 100644
index 0000000..90ff0f1
--- /dev/null
+++ b/modules/tags/tag.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+name='rvs @ID@ tag'
+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>.
+
+# tag ID TAG
+usage="usage: $RVS tag ID TAG"
+ ID="${1?"$usage"}"
+tag="${2?"$usage"}"
+
+file="$REPO/@ID@/$tag"
+mkdir -p "`dirname "$file"`"
+echo "$ID" > "$file"
+