11function _setup()
22{
3+ # This is for Windows Git-Bash, so we can include `bc.exe`
4+ export PATH=${PATH} :$( pwd)
35 # # Git-SVN has issues on Mac... don't try it. Just use Docker or a VM
4- [[ $( uname) != ' Linux' ]] && echo " Sorry, this works only with Linux" && exit 1
6+ if [[ $( uname) != ' Linux' ]]
7+ then
8+ source settings.ini
9+ else
10+ INC_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
11+ [[ -f ${INC_DIR} /settings.ini ]] && source ${INC_DIR} /settings.ini
12+ fi
513 # # If we have a settings file, use it to bypass input
6- INC_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
7- [[ -f ${INC_DIR} /settings.ini ]] && source ${INC_DIR} /settings.ini
814 rm -f /tmp/{submodules,github_remotes}.txt
915 # # If there's no settings file, ask for input
1016 # # This can be stored your the environment as well
@@ -272,6 +278,16 @@ function _discover_submodules()
272278 fi
273279}
274280
281+ function _create_gitignore()
282+ {
283+
284+ # Create .gitignore
285+ git svn show-ignore\
286+ | grep [a-zA-Z0-9]\
287+ | grep -v ' ^#' \
288+ | sed ' s/^\///g' >> .gitignore
289+ }
290+
275291# # Discover what our repository looks like
276292function _get_svn_layout()
277293{
@@ -286,7 +302,7 @@ function _get_svn_layout()
286302 if [[ ! -z ${TRUNK} ]] && [[ ! -z ${ROOT_FILES} ]]
287303 then
288304 clear
289- echo " Repository Name : ${REPO_NAME } " && echo " "
305+ echo " Repository: ${REPO_URL } " && echo " "
290306 _print_banner " You have a non-empty \" trunk\" folder, but there are also" \
291307 " files/folders in the root of your repository. There is" \
292308 " no way to intelligently know what to do with these, and" \
@@ -373,7 +389,7 @@ function _git_svn_clone()
373389 RESULT=$?
374390 while [[ ${RESULT} -ne 0 ]]
375391 do
376- if [[ ${RETRY_COUNT} -gt 5 ]]
392+ if [[ ${RETRY_COUNT} -ge 5 ]]
377393 then
378394 echo " " && echo " "
379395 echo " It would appear that retrying is a pointless venture."
@@ -409,7 +425,8 @@ function _git_svn_clone()
409425 done
410426 if [[ " ${RETRY,,} " == " no" ]]
411427 then
412- RESULT=0
428+ git svn reset ${OLD_REV} & >> ${LOG_FILE} > /dev/null
429+ RESULT=$?
413430 else
414431 showBar ${CURRENT_REV} ${REV_COUNT}
415432 echo -e " " && echo -e " REV: ${REV} "
0 commit comments