1 SVN info
Gets the basic information for the current local code base.
Take the version number of the current local code
SVN info trunk/| Awk-f ': ' {if ($ ~/^revision$/) {print $}} ' | Tr-d ""
2 SVN log
Gets the submit content for a revision. -V Displays a list of files specifically submitted for modification,-r specifies the version number.
3 svn diff
Compare the differences between the two version numbers.
4 svn checkout/update
Check out code SVN checkouthttp://127.0.0.1/repos/trunk
Update Code SVN update trunk/
5 Application Examples
Get the submission record between the version numbers before and after the update, and modify the content comparison.
#!/usr/bin/bash
repo=$1
#Save old revision
old_rev= ' svn info $repo | \
awk-f ': ' {if ($ ~/^revision$/ ) {print $}} ' | \
tr-d "" '
echo Old revision: $old _rev
#Update code
SVN Update $repo
#Save New revision before Te
new_rev= ' svn info $repo | \
awk-f ': ' {if ($ ~/^revision$/) {print $}} ' | \
tr-d ' "'
echo N EW revision: $new _rev
#Generate diff
if [$old _rev = = $new _rev] then
echo No revision Commited.
else
svnlog-v-R $old _rev: $new _rev $repo
svn diff-r $old _rev: $new _rev $repo
fi
reference materials
Http://www.subversion.org.cn/svnbook/1.4/svn.ref.svn.c.log.html
Http://www.subversion.org.cn/svnbook/1.2/svn.tour.history.html