Share a svn merge script in linux #! /Bin/bash # svn merge script www.2cto.com # svn version library address BRANCHES_URL = svn: // xxx; # version = $1 if [[$ # = 0]; then usage; exit; fi if [$? -Ne 0]; then echo 'version number must be 'exitfi echo '-------------------------------------- [start] --------------------------------------' # record the svn branch path of the corresponding file and the action to be executed to the svn log-r $ version in the temporary file -qv $ BRANCHES_URL | grep/| awk "{print \ $1 \ $2}">/tmp/svn_merge_info I = 1for f in 'cat/tmp/svn_merge_info 'do # Get type of the executed action svn_cmd = 'expr substr $ f 1 'f = 'echo $ f | sed-e "s/^. // "'# obtain the file path, for example,/js/test. js (File branch path:/branches/m Aster/js/test. js |/trunk/js/test. js) local_f = 'echo $ f | sed-e "s/\/branches \/[^/] * //" | sed-e "s/\/trunk //"' case $ svn_cmd in) tmp = "svn copy-r $ version $ {BRANCHES_URL} $ f. $ local_f "; M) tmp =" svn merge-r $ (version-1): $ version -- ignore-ancestry $ BRANCHES_URL $ f. $ local_f "; D) tmp =" svn del. $ local_f "; *) echo" commands not supported currently "exit; esac echo 'echo" command: $ tmp "echo'' echo "result: "ttmp = '$ tmp' Result = $? Echo $ ttmp echo ''echo "response $ I ----------------------------------------" I = 'expr $ I + 1' done # obtain the branch name tmp_branche = 'svn log $ BRANCHES_URL-r $ version-qv | tail-n 2 | head-n 1 | sed-r-e "s /. * branches \/([^/] *). */\ 1/"'branche = $ tmp_branchesvn commit-m" is merged from $ version of the $ branche branch and automatically submits "echo '-------------------------------------- [end] Comment'