Share a svn merge script in linux

Source: Internet
Author: User
Share a svn merge script in linux #! /Bin/bash # svn merge script www.2cto.com # svn repository address BRANCHES_URLsvn: // xxx; # version $ 1if [[$ #0]; thenusage; exit; fiif [$? -Ne0];...
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'
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.