| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_updateRepoChanges { |
| |
| |
| if [[ $FLAG_DONT_COMMIT_CHANGES != 'false' ]];then |
| return |
| fi |
| |
| local -a FILES |
| local -a INFO |
| local -a FILESNUM |
| local COUNT=0 |
| local UPDATEOUT='' |
| local PREDICATE='' |
| local CHNGTOTAL=0 |
| local LOCATIONS='' |
| |
| |
| |
| |
| if [[ "$@" != '' ]];then |
| LOCATIONS="$@" |
| else |
| LOCATIONS="$ACTIONVAL" |
| fi |
| |
| |
| cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line |
| UPDATEOUT=$(svn update ${LOCATIONS}) |
| |
| |
| |
| FILES[0]=$(echo "$UPDATEOUT" | egrep "^A.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") |
| FILES[1]=$(echo "$UPDATEOUT" | egrep "^D.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") |
| FILES[2]=$(echo "$UPDATEOUT" | egrep "^U.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") |
| FILES[3]=$(echo "$UPDATEOUT" | egrep "^C.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") |
| FILES[4]=$(echo "$UPDATEOUT" | egrep "^G.+$(cli_getRepoTLDir "${LOCATIONS}").+$" | sed -r "s,^.+($(cli_getRepoTLDir "${LOCATIONS}").+)$,\1,") |
| |
| |
| |
| INFO[0]="`gettext "Added"`" |
| INFO[1]="`gettext "Deleted"`" |
| INFO[2]="`gettext "Updated"`" |
| INFO[3]="`gettext "Conflicted"`" |
| INFO[4]="`gettext "Merged"`" |
| |
| while [[ $COUNT -ne ${#FILES[*]} ]];do |
| |
| |
| if [[ "${FILES[$COUNT]}" == '' ]];then |
| FILESNUM[$COUNT]=0 |
| else |
| FILESNUM[$COUNT]=$(echo "${FILES[$COUNT]}" | wc -l) |
| fi |
| |
| |
| CHNGTOTAL=$(($CHNGTOTAL + ${FILESNUM[$COUNT]})) |
| |
| |
| |
| |
| |
| |
| |
| PREDICATE[$COUNT]=`ngettext "file from the repository" \ |
| "files from the repository" $((${FILESNUM[$COUNT]} + 1))` |
| |
| |
| cli_printMessage "${INFO[$COUNT]}: ${FILESNUM[$COUNT]} ${PREDICATE[$COUNT]}" |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |