[Laszlo-checkins] r11107 - tools/trunk/svn
dda@openlaszlo.org
dda at openlaszlo.org
Fri Sep 19 09:40:15 PDT 2008
Author: dda
Date: 2008-09-19 09:40:14 -0700 (Fri, 19 Sep 2008)
New Revision: 11107
Modified:
tools/trunk/svn/svn-bash.sh
Log:
If $SVNPASSWD (or $USER) are not set in the environment, don't use
svn's --username and --password options. If the user already has
ssh access to the SVN machine, this will work directly without putting
passwords in files or environment variables.
Deduce the revision number of the completed checkin, so that the
message to the user is more helpful, listing the exact command
needed to get the log info.
Modified: tools/trunk/svn/svn-bash.sh
===================================================================
--- tools/trunk/svn/svn-bash.sh 2008-09-19 16:29:42 UTC (rev 11106)
+++ tools/trunk/svn/svn-bash.sh 2008-09-19 16:40:14 UTC (rev 11107)
@@ -146,6 +146,23 @@
}
+function _svn_ci()
+{
+ # last arg should be a file listing svn files,
+ # (expecting this to be used as "_svn_ci .... --targets /.../files.txt" )
+ # need one of the files in files.txt to get the new revision number
+ _lastarg=${!#}
+ _committed_file=`head -1 < $_lastarg`
+ svn ci "$@" && _newrev=`svn info "$_committed_file" |
+ sed -e '/Revision: /!d' -e 's/.*: //'` &&
+ (printf "\n\n\
+Remember to update any Jira entries for bugs that are fixed by your\n\
+change. Note the svn revision number above. Run:\n\n\
+ svn log -v -r$_newrev\n\
+and paste the output into Jira as the comment when\n\n\
+resolving the bug. Also update the Fixed in Change# field with your\n\
+revision number: $_newrev.\n\n" 1>&2)
+}
# Check in a change that has been reviewed
# Arguments: [changename]
@@ -161,14 +178,14 @@
files="${changedir}/files.txt"
sed -e '1,/^Files:/d' -e 's/^[A-Z +]\{6\} *//' < "${change}" > "${files}"
sed -e '/^Files:/,$d' < "${change}" > "${message}"
- svn ci --file "${message}" --username "${USER}" --password "${SVNPASSWD}" --targets "${files}" && \
- (printf "\n\n\
-Remember to update any Jira entries for bugs that are fixed by your\n\
-change. Note the svn revision number above. Run svn log -v\n\
--r<revision number> and paste the output into Jira as the comment when\n\
-resolving the bug. Also update the Fixed in Change# field with your\n\
-svn <revision number>.\n\n" 1>&2) && \
+ # If there is no SVNPASSWD, assume user has ssh privileges
+ if [ "${USER}" != '' -a "${SVNPASSWD}" != '' ]; then
+ _svn_ci --file "${message}" --username "${USER}" --password "${SVNPASSWD}" --targets "${files}" && \
rm -r "${changedir}"
+ else
+ _svn_ci --file "${message}" --targets "${files}" && \
+ rm -r "${changedir}"
+ fi
else
echo "$changename inaccessible"
return -1
More information about the Laszlo-checkins
mailing list