OSSP CVS Repository

ossp - Difference in ossp-pkg/svs/svs.sh versions 1.3 and 1.4
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/svs/svs.sh 1.3 -> 1.4

--- svs.sh       2004/12/17 09:52:08     1.3
+++ svs.sh       2005/01/13 11:12:58     1.4
@@ -33,6 +33,7 @@
     echo "Usage: svs vi <file> [...]"
     echo "Usage: svs diff [<file>|<dir> [...]]"
     echo "Usage: svs backout [<file>|<dir> [...]]"
+    echo "Usage: svs status [<file>|<dir> [...]]"
     exit 1
 fi
 
@@ -74,6 +75,9 @@
                 rm -f $file.orig
             else
                 echo "svs: changes made (preserving original)"
+                if [ -f $file.rej ]; then
+                    rm -f $file.rej
+                fi
             fi
         done
         ;;
@@ -177,6 +181,42 @@
             fi
         done
         ;;
+
+    s|st|sta|stat|statu|status )
+        ##
+        ##  CHANGE STATUS
+        ##
+
+        #   determine file list
+        if [ $# -eq 0 ]; then
+            set -- .
+        fi
+        files=""
+        for file in "$@"; do
+            if [ -d $file ]; then
+                for f in `find $file -type f \( -name "*.orig" -or -name "*.rej" \) -print | sort`; do
+                    files="$files $f"
+                done
+            elif [ -f $file ]; then
+                files="$files $file"
+            else
+                echo "svs:ERROR: \"$file\" neither regular file nor directory" 1>&2
+                exit 1
+            fi
+        done
+
+        #   show status on files
+        for file in $files; do
+            file=`echo "$file" | sed -e 's;^\./;;' -e 's;/\./;/;g' -e 's;\([^/][^/]*\)/\.\.;;g' -e 's;//*;/;g'`
+            prefix="?"
+            case "$file" in
+                *.orig ) prefix="M" ;;
+                *.rej  ) prefix="C" ;;
+            esac
+            echo "$prefix $file"
+        done
+        ;;
+
     * )
         echo "svs:ERROR: invalid command \"$cmd\"" 1>&2
         exit 1

CVSTrac 2.0.1