Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-07

handy svn update script

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Below is a svn update script for *nix based systems. I often want to check the logs after I did a update, to see what changed. I then sit with the problem, that I can't remember the revision I upgraded from. This doesn't just relate to Lazarus subversion, but to many other projects as well. Anyway, this little script will report the before and after revision once the update is complete.. I thought someone might find this handy.

--------------------[ svnup.sh ]---------------------------- #!/bin/bash

oldrev=$(svn info |grep '^Revision: '|sed 's/Revision: //g')

svn up

newrev=$(svn info |grep '^Revision: '|sed 's/Revision: //g')

[ "$oldrev" == "$newrev" ] || {
echo " "
echo "Made the step from $oldrev to $newrev "
}
--------------------[ end ]----------------------------

Here is a sample of the output...

--------------------[ start ]---------------------------- $> svnup.sh
...
U lcl/lconvencoding.pas
U lcl/controls.pp
U packager/packagesystem.pas
A examples/synpositionhighlighter
A examples/synpositionhighlighter/unit1.lrs
A examples/synpositionhighlighter/unit1.pas
A examples/synpositionhighlighter/unit1.lfm
Updated to revision 15901.

Made the step from 15864 to 15901
--------------------[ end ]----------------------------

:-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Henry Vermaak
to Graeme Geldenhuys

2008/7/28 Graeme Geldenhuys :

Show quoted text 26 lines
Hi, Below is a svn update script for *nix based systems. I often want to check the logs after I did a update, to see what changed. I then sit with the problem, that I can't remember the revision I upgraded from. This doesn't just relate to Lazarus subversion, but to many other projects as well. Anyway, this little script will report the before and after revision once the update is complete.. I thought someone might find this handy. --------------------[ svnup.sh ]---------------------------- #!/bin/bash oldrev=$(svn info |grep '^Revision: '|sed 's/Revision: //g') svn up newrev=$(svn info |grep '^Revision: '|sed 's/Revision: //g') [ "$oldrev" == "$newrev" ] || { echo " " echo "Made the step from $oldrev to $newrev " } --------------------[ end ]----------------------------

you can drop the grep and use:

svn info | sed -n 's/^Revision: //p'

;)

Reply by email

Henry Vermaak
to Graeme Geldenhuys: Below is a svn update script for *nix based systems. I often want to check the logs…

2008/7/28 Graeme Geldenhuys :

Show quoted text 5 lines
Hi, Below is a svn update script for *nix based systems. I often want to check the logs after I did a update, to see what changed. I then sit with the problem, that I can't remember the revision I upgraded from.

i often use svn log -r head:base to see if i really want to update and rebuild.

henry

Reply by email

Graeme Geldenhuys
to Henry Vermaak
Henry Vermaak wrote
i often use svn log -r head:base to see if i really want to update and rebuild.

That is handy, yes. Unfortunately I often need to upgrade to the latest (even if I don't want to), so I can test a bugfix etc... And afterwards revert to my prior revision or stay with the current one if all checks out ok.

Lazarus is such a case in point. I often upgrade to test a bugfix, then revert back to something more stable for my development work.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email