We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

zingo on 06/17/07


Tagged

svn Bash subversion


Versions (?)


Who likes this?

5 people have marked this snippet as a favorite

jarjar2k7
leachypeachy
jayallen
Juanje
mitry


Display svn changelog on "svn up"


Published in: Bash 


URL: http://woss.name/2007/02/01/display-svn-changelog-on-svn-up/

updates (svn up) a working copy and displays the changes

  1. # Get the current revision of a repository
  2. svn_revision()
  3. {
  4. svn info $@ | awk '/^Revision:/ {print $2}'
  5. }
  6.  
  7. # Does an svn up and then displays the changelog between your previous
  8. # version and what you just updated to.
  9. svn_up_and_log()
  10. {
  11. local old_revision=`svn_revision $@`
  12. local first_update=$((${old_revision} + 1))
  13. svn up -q $@
  14. if [ $(svn_revision $@) -gt ${old_revision} ]; then
  15. svn log -v -rHEAD:${first_update} $@
  16. else
  17. echo "No changes."
  18. fi
  19. }

Report this snippet 

You need to login to post a comment.