by Rich Rousseau
20. August 2007 23:39
Some quick functions I created to reduce my time at the subversion command line. The trick here is that I couldn't just alias the commands, I needed to create some small functions for each...
function st {Invoke-Expression "svn status"}
function sup {Invoke-Expression "svn update"}
function sci {Invoke-Expression "svn ci"} --I use the %SVN_EDITOR% env var for my checkin message editing
function sin {Invoke-Expression "svn info"}
You could easily modify these to accept parameters...
function srv ([string]$filename){Invoke-Expression "svn revert $filename"}
I imagine I'll want these to be more flexible in the future, but for now they're saving me a lot of typing!
by Rich Rousseau
24. March 2006 04:30
Not all DateAdd()s are created equal.
Example:
VBScript
DateAdd("m", -1, CDate("01/01/2006"))
Expected Result: 12/01/2005
Actual Result: 12/01/
2006 - WTF?
TSQL
DateAdd(m, -1, '20060101')
Expected Result: 12/01/2005
Actual Result: 12/01/2005
Moral of the story, not all functions behave like you expect them to. Test, test and retest.