SVN common Shortcut command set.

Source: Internet
Author: User

When the branch merge back to the trunk, sometimes need to only submit their own modified files, but many of the files are actually not moved on the branch, but it shows a change, this is actually the property has changed. SVN records the merge record through Svn:mergeinfo. So sometimes it's necessary to revert the file with only the attribute changes. You can use the following command at this time:

        -V: Introduction. -M: Accept my conflict. -T: Accept his conflict.-R:revert        svnopc: Displays files that only attribute conflicts. The acceptable parameters are-v,-m,-T.        SVNOPM: Displays only files that have changed properties. Acceptable Parameters-R.        Svnc: Displays all conflicting files. can accept-m,-T.        Svnmm:merge Trunk        SVNMB: Accepts a branch URL parameter and merges the branch back into the trunk.        MYSVNHELP: Displays this paragraph. 

Note that the SVN tree conflict does not support the option to use RESOLVE-TC,RESOLVE-MC. Need

gawk ' /^ M/{print} ' gawk ' {print $NF} ' Xargs svn revert

From the SVN help St can see the second column of the target is the property changes, if you have not changed the properties of the file, then you can use this command can only change the properties of the file revert out.

However, if the file name contains ' @ ', you need to add a ' @ ' after the file name. So SVN St can be changed into

gawk ' /@/{print $ "@"}!/@/{print $} '

Sometimes you need to look at the conflicting files, you can use the following command

gawk  ' !/^[^c]{7,7}/{print $} '

The first column of the SVN St shows the status of the content, the second column is the attribute state, and the seventh column is the tree conflict.

If you view files that only attribute conflicts can be used with SVN St | Gawk '/^[^c]c/{print} '

You can use alias to write these frequently used commands into a quick command, written in ~/.bash_profile.

I have written several frequently used quick commands. Several of the following features are supported. SVNMM need to set their own location under the trunk, in fact, can be through the svn log-v--stop-on-copy to intercept the main position, but rather than directly set as a fixed command. SVNMM and SVNMB both use--accept p directly. The contents of the SVN attribute conflict will be written in Confictfilename.prej. This way, with svnopc-v, you can view the first two lines of a property conflict file. Usually the first two lines summarize the cause of the conflict.

        -V: Introduction. -M: Accept my conflict. -T: Accept his conflict.-R:revert        svnopc: Displays files that only attribute conflicts. The acceptable parameters are-v,-m,-T.        SVNOPM: Displays only files that have changed properties. Acceptable Parameters-R.        Svnc: Displays all conflicting files. can accept-m,-T.        Svnmm:merge Trunk        SVNMB: Accepts a branch URL parameter and merges the branch back into the trunk.        MYSVNHELP: Displays this paragraph. 

Cut a few figures to show. Svnopc-v

Svnc-t

Export path=/opt/subversion/Bin: $PATHmaster="HTTP:YOURSVN"functionMyhelp_fn () {Echo '-V: Introduction. -M: Accept my conflict. -T: Accept his conflict.r:revert svnopc: Displays files with only attribute conflicts. Acceptable Parameters-v,-m,-T. and the specific file name, if it is a specific filename will be the. prej file together. SVNOPM: Displays only files that have changed properties. Acceptable Parameters-R. Svnc: Displays all conflicting files. is acceptable-m,-T. Svnmm:merge backbone SVNMB: Accepts a branch URL parameter and merges the branch back into the trunk.    MYSVNHELP: Displays this paragraph. '}alias mysvnhelp=Myhelp_fnalias Svnstat="SVN St | gawk '/@/{print \$0\ "@\"}!/@/{print \$0} '"functionSvnopc_fn () {IFS=$'\ n'Local Pcfiles= ' SVN St |gawk '/^[^c]c/{print}'`    if[$#-eq0] ; Thenprintf'%s\n' "${pcfiles[@]}"    fi    if[$#-eq1] && [$1=='- v'] ; Then         forIinch "${pcfiles[@]}"         Doprintf'%s \ n'$i |gawk '{print $NF ". Prej"}'|Xargs Head-N2         Done    fi    if[$#-eq1] && [$1=='- M'] ; Thenprintf'%s\n' "${pcfiles[@]}"|gawk '{print $NF}'|XargsSVN Resolve--Accept MCfi    if[$#-eq1] && [$1=='- T'] ; Thenprintf'%s\n' "${pcfiles[@]}"|gawk '{print $NF}'|XargsSVN Resolve--Accept TCfi        if[$#-eq1] && [-A $1] && [-A"$1.prej"]; Then        Cat$1". Prej"    fiunset ifs}alias Svnopc=SVNOPC_FNfunctionSvnopm_fn () {if[$#-eq0] ; ThenSVN St|gawk '/^ M/{print}'    fi    if[$#-eq1] && [$1=='- R'] ; ThenSVNStat|gawk '/^ M/{print}'|gawk '{print $NF}'|Xargssvn revertfi}alias svnopm=SVNOPM_FNfunctionSvnc_fn () {if[$#-eq0] ; ThenSVN St|gawk--re-interval'!/^[^c]{7,7}/{print $}'    fi    if[$#-eq1] && [$1=='- M'] ; ThenSvnstat|gawk--re-interval'!/^[^c]{7,7}/{print $NF}'|XargsSVN Resolve--Accept MCfi    if[$#-eq1] && [$1=='- T'] ; ThenSvnstat|gawk--re-interval'!/^[^c]{7,7}/{print $NF}'|XargsSVN Resolve--Accept TCfi}alias Svnc=Svnc_fnalias svnmm='echo $master | xargs bash-c "echo \$0 &&svn merge \$0--accept P"'alias SVNMB='svn merge--accept p--reintegrate'alias Sourceup='Source ~/.bash_profile'

SVN common Shortcut command set.

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.