1
1
function _setup()
2
2
{
3
+ # This is for Windows Git-Bash, so we can include `bc.exe`
4
+ export PATH=${PATH} :$( pwd)
3
5
# # 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
5
13
# # 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
8
14
rm -f /tmp/{submodules,github_remotes}.txt
9
15
# # If there's no settings file, ask for input
10
16
# # This can be stored your the environment as well
@@ -272,6 +278,16 @@ function _discover_submodules()
272
278
fi
273
279
}
274
280
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
+
275
291
# # Discover what our repository looks like
276
292
function _get_svn_layout()
277
293
{
@@ -286,7 +302,7 @@ function _get_svn_layout()
286
302
if [[ ! -z ${TRUNK} ]] && [[ ! -z ${ROOT_FILES} ]]
287
303
then
288
304
clear
289
- echo " Repository Name : ${REPO_NAME } " && echo " "
305
+ echo " Repository: ${REPO_URL } " && echo " "
290
306
_print_banner " You have a non-empty \" trunk\" folder, but there are also" \
291
307
" files/folders in the root of your repository. There is" \
292
308
" no way to intelligently know what to do with these, and" \
@@ -373,7 +389,7 @@ function _git_svn_clone()
373
389
RESULT=$?
374
390
while [[ ${RESULT} -ne 0 ]]
375
391
do
376
- if [[ ${RETRY_COUNT} -gt 5 ]]
392
+ if [[ ${RETRY_COUNT} -ge 5 ]]
377
393
then
378
394
echo " " && echo " "
379
395
echo " It would appear that retrying is a pointless venture."
@@ -409,7 +425,8 @@ function _git_svn_clone()
409
425
done
410
426
if [[ " ${RETRY,,} " == " no" ]]
411
427
then
412
- RESULT=0
428
+ git svn reset ${OLD_REV} & >> ${LOG_FILE} > /dev/null
429
+ RESULT=$?
413
430
else
414
431
showBar ${CURRENT_REV} ${REV_COUNT}
415
432
echo -e " " && echo -e " REV: ${REV} "
0 commit comments