nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Shell Script for adding, removing and commiting the SVN (Subversion system )

This is a discussion on Shell Script for adding, removing and commiting the SVN (Subversion system ) within the Shell scripting forums, part of the Development/Scripting category; Code: Dear friends this script is useful for SVN Code: #!/bin/bash #################################################################################### ############ Script for svn ######################################################## ## This script ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-07-2007, 05:40 PM
anilvrathod's Avatar
Junior Member
User
 
Join Date: Dec 2007
Location: Pune
My distro: Red Hat
Posts: 13
Rep Power: 0
anilvrathod is on a distinguished road
Default Shell Script for adding, removing and commiting the SVN (Subversion system )

Code:
Dear friends this script is useful for SVN
Code:
#!/bin/bash
####################################################################################
############ Script for svn ########################################################
## This script is used for to add those files which are not added into SVN.       ##
## This script is also used do delete the files which have the extension .bak.    ##
## this script provide the " svn commit/update with message "               ##
## there are three section in this script                                                                    ##
# SECTION  I -------- for removes the  *.bak files                                ##
# SECTION  II ------- for add the files into svn repository                       ##
# SECTION  III ------ for svn commit with message and without message             ##
####################################################################################
#### ********** ANIL RATHOD *************                                        ###
####################################################################################
clear

 path="/path_of_svn_Directory "
cd $path

########SECTION -I:  Remove the *.bak
        DELETECOUNT=`svn status   | grep ".bak"  |wc -l`
        if [ $DELETECOUNT = "0" ]
        then
           until [ $DELETECOUNT -lt "0" ]
           do
                echo "All file with having *.bak are deleteing ....Please wait ."
                DELETE=` svn status  | grep ".bak" | awk {'print $2'} | head -$DELETECOUNT | tail -1 `
                rm -rf $DELETE
                echo "All .bak Files  are Deleting .............. "
              DELETECOUNT=`expr $DELETECOUNT - 1 `
           done
        fi

#########SECTION -II : Add file section
        COUNT=`svn status   | grep ^?  |wc -l`
        until [ $COUNT -lt "0" ]
        do
             CURRENT=`svn status  | grep ^? |awk {'print $2'} | head -$COUNT | tail -1`
echo "Are you want to add $CURRENT file ? (y/n/skip)..."
             read ANS
                if [ $ANS = "y" ]
                then
                        svn add $CURRENT
                        echo "****  FILE $CURRENT ADDED  **** "
                else if [ $ANS = "n"  ]
                     then
                              echo "*** File  $CURRENT  NOTADDED ***"
                      else if [ $ANS = "skip" ]
                           then
                                break
                           fi
                           echo "Please Insert proper option........... "
                           sleep 1
                           exit
                        fi
                 fi
        COUNT=`expr $COUNT - 1 `
        done
#############SECTION -III : svn COMMIT

        echo "Are you want to COMMIT ..........(y/n/skip)"
        read COMMITANS
        if [ $COMMITANS = "y" ]
        then
                echo "Enter your commitment MESSAGE....... "
                read MSG
                #***svn commit -m "$MSG_`date +%F`"
                echo "svn Commited with message :- $MSG `date +%F`"
        else if [ $COMMITANS = "n"  ]
               then
                echo "Enter your commitment MESSAGE....... "
                read MSG
                #***svn commit -m "$MSG_`date +%F`"
                echo "svn Commited with message :- $MSG `date +%F`"
        else if [ $COMMITANS = "n"  ]
               then
                      echo "*************************"
                      echo "COMIITED  without message"
                      echo "*************************"
                        #***svn commit -m "without_message_commited_on_`date +%F`"
                      exit
               else if [ $ANS = "skip" ]
                     then
                              break
                      fi
                      else
                           echo "Please Insert proper option........... "
                           sleep 1
                           exit
                 fi

        fi
Anil V. Rathod
Linux System Administrator
Kalinga Data Link Pvt. Ltd.Pune
Cell No. 986006217

Last edited by anilvrathod; 12-11-2007 at 01:17 PM.
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
problem in adding ip route ranjithtechser HP-UX 0 11-09-2007 05:28 PM
A script for Removing all the files inside a folder and its sub folder vivekv Shell scripting 1 10-25-2007 01:44 PM
writing a shell script to find out my shell name jaymob123 Shell scripting 1 10-08-2007 12:36 AM
problem with System + MySQL backup script massoo Shell scripting 1 08-20-2007 09:50 PM
Shell scripting - Removing file extension urbanreformer Shell scripting 3 03-07-2007 08:44 PM


All times are GMT +5.5. The time now is 11:21 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36