support for diff
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 30 Jul 2007 11:23:54 +0000 (11:23 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 30 Jul 2007 11:23:54 +0000 (11:23 +0000)
scripts/import-module.sh

index 6fd099b..32e4c36 100755 (executable)
@@ -302,7 +302,6 @@ function import_module () {
 }
 
 ##############################
-
 function tag_usage () {
    echo "Usage: $0 module"
    exit 1
@@ -403,13 +402,37 @@ function tag_module () {
     done    
 }
 
+####################
+function diff_modules () {
+    for module in "$@" ; do
+       tagtrunk=$HOME/tags/$module/trunk
+       echo "--------------------Checking $module"
+       run_prompt y "Updating $tagwork" svn update $tagtrunk
+        ### extracting current version info
+       spec=$(figure_module_spec $tagtrunk $module)
+       version=$(extract_from_spec $spec version)
+       subversion=$(extract_from_spec $spec subversion)
+
+       echo "FOUND spec=$spec version=$version subversion=$subversion"
+
+       lasttag=$svn/$module/tags/$module-${version}.${subversion}
+       trunk=$svn/$module/trunk
+       
+       run_prompt y "Diffing : < last tag -- trunk >" svn diff $lasttag $trunk
+       
+    done
+}
+
+####################
 case $0 in
-  *import-module*)
-    import_module $@;;
-  *tag-module*)
-    tag_module $@;;
-  *test*)
-    x=$(figure_module_spec $@) ; echo $x;;
-  *)
-    echo "Unsupported command $0" ; exit 0
-  esac
+    *import-module*)
+       import_module $@;;
+    *tag-module*)
+       tag_module $@;;
+    *diff-module*)
+       diff_modules $@ ;;
+    *test*)
+       x=$(figure_module_spec $@) ; echo $x;;
+    *)
+       echo "Unsupported command $0" ; exit 0
+esac