| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function subversion_updateRepoChanges { |
| |
| local -a FILES |
| local -a INFO |
| local -a FILESNUM |
| local COUNT=0 |
| local UPDATEOUT='' |
| local PREDICATE='' |
| local CHNGTOTAL=0 |
| local LOCATION=$(cli_checkRepoDirSource "$1") |
| |
| |
| |
| |
| |
| |
| cli_checkFiles ${LOCATION} -e --is-versioned |
| |
| |
| cli_printMessage "`gettext "Bringing changes from the repository into the working copy"`" --as-banner-line |
| UPDATEOUT=$(${COMMAND} update ${LOCATION} --quiet) |
| |
| |
| |
| FILES[0]=$(echo "$UPDATEOUT" | egrep "^A" | sed -r "s,^.+${TCAR_WORKDIR},,") |
| FILES[1]=$(echo "$UPDATEOUT" | egrep "^D" | sed -r "s,^.+${TCAR_WORKDIR},,") |
| FILES[2]=$(echo "$UPDATEOUT" | egrep "^U" | sed -r "s,^.+${TCAR_WORKDIR},,") |
| FILES[3]=$(echo "$UPDATEOUT" | egrep "^C" | sed -r "s,^.+${TCAR_WORKDIR},,") |
| FILES[4]=$(echo "$UPDATEOUT" | egrep "^G" | sed -r "s,^.+${TCAR_WORKDIR},,") |
| |
| |
| |
| 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]}" --as-stdout-line |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |