Posted to tcl by venks at Thu Oct 28 03:25:07 GMT 2010view raw

  1. --- svn-to-fossil.sh.2 2010-10-26 12:08:03.000000000 -0700
  2. +++ svn-to-fossil.sh 2010-10-27 14:23:36.000000000 -0700
  3. @@ -38,6 +38,8 @@
  4. echo "Processing r${rev}..."
  5. svnrevlog="$(svn log -r"${rev}" "${SVN_URL}")"
  6.  
  7. +
  8. + commituser="$(echo "${svnrevlog}" | head -n 2 | tail -n 1 | cut -f 2 -d '|' | sed 's@ @@g')"
  9. committime="$(echo "${svnrevlog}" | head -n 2 | tail -n 1 | cut -f 3 -d '|' | sed 's@^ *@@;s@(.*$@@;s@ *$@@')"
  10. committime_sec="$(date -d "${committime}" +%s)"
  11. committime_ps="$(echo "puts [clock format \"[expr {$committime_sec - 1}]\" -format {%Y-%m-%d %H:%M:%S}]" | tclsh)"
  12. @@ -134,8 +136,8 @@
  13. fi
  14.  
  15. # Commit
  16. - fossil commit -date-override "${committime}" -m "${commit_msg}" || (
  17. - if fossil commit -date-override "${committime}" -m "${commit_msg}" 2>&1 | grep 'nothing has changed'; then
  18. + fossil commit -date-override "${committime}" -user-override "${commituser}" -m "${commit_msg}" || (
  19. + if fossil commit -date-override "${committime}" -user-override "${commituser}"-m "${commit_msg}" 2>&1 | grep 'nothing has changed'; then
  20. exit 0
  21. fi
  22.  
  23.  

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)"