Posted to tcl by venks at Thu Oct 28 03:25:07 GMT 2010view raw
- --- svn-to-fossil.sh.2 2010-10-26 12:08:03.000000000 -0700
- +++ svn-to-fossil.sh 2010-10-27 14:23:36.000000000 -0700
- @@ -38,6 +38,8 @@
- echo "Processing r${rev}..."
- svnrevlog="$(svn log -r"${rev}" "${SVN_URL}")"
- +
- + commituser="$(echo "${svnrevlog}" | head -n 2 | tail -n 1 | cut -f 2 -d '|' | sed 's@ @@g')"
- committime="$(echo "${svnrevlog}" | head -n 2 | tail -n 1 | cut -f 3 -d '|' | sed 's@^ *@@;s@(.*$@@;s@ *$@@')"
- committime_sec="$(date -d "${committime}" +%s)"
- committime_ps="$(echo "puts [clock format \"[expr {$committime_sec - 1}]\" -format {%Y-%m-%d %H:%M:%S}]" | tclsh)"
- @@ -134,8 +136,8 @@
- fi
- # Commit
- - fossil commit -date-override "${committime}" -m "${commit_msg}" || (
- - if fossil commit -date-override "${committime}" -m "${commit_msg}" 2>&1 | grep 'nothing has changed'; then
- + fossil commit -date-override "${committime}" -user-override "${commituser}" -m "${commit_msg}" || (
- + if fossil commit -date-override "${committime}" -user-override "${commituser}"-m "${commit_msg}" 2>&1 | grep 'nothing has changed'; then
- exit 0
- fi
Comments
Posted by venks at Thu Oct 28 03:33:27 GMT 2010 [text] [code]
Also the awk line is wrong (it gets a line of - s) commit_msg="$(echo "${svnrevlog}" | awk 'BEGIN { getline; getline; getline } { print }')" Instead use the -n flag to tail from the line from before: commit_msg="$(echo "${svnrevlog}" | tail -n +4 | head -n -1)"