Changeset 319


Ignore:
Timestamp:
05/02/2009 20:32:54 (3 years ago)
Author:
ccowart
Message:
  • Implemented abort option on empty log.
  • Cleaned up some logic surrounding determining no changes.

Fixes #24

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/confman.in

    r318 r319  
    115115        conf_lock_wcopy 
    116116        local msg=$(conf_tmp_file) 
    117                 local status=$(conf_tmp_file) 
     117        local orig_msg=$(conf_tmp_file) 
     118        local status=$(conf_tmp_file) 
    118119        local modules=$(conf_get_recipe | tr '\n' ',')  
    119120        local ignoreline="--This line, and those below, will be ignored--" 
     
    125126            ${WORK_PATH}/% >> $status 
    126127                cat $status >> $msg 
     128        cp $msg $orig_msg 
    127129                if [ $(wc -l < $status) -gt 0 ] ; then 
    128130                ${EDITOR} $msg 
     131            if diff $msg $orig_msg >/dev/null 2>&1 ; then 
     132                echo "Log message unchanged. (a)bort / (C)ontinue?" 
     133                read response 
     134                if [ "${response}" = "a" ] ; then 
     135                    conf_unlock_wcopy 
     136                    conf_unlock_system 
     137                    return 1 
     138                fi 
     139            fi 
    129140                fi 
    130                 rm -f $status 
     141                rm -f $status $orig_msg 
    131142        ${sed_cmd} -i '' -e '/'"$ignoreline"'/,$d' $msg 2>/dev/null 
    132143        $SUDO ${SUDO:+-v} 
     
    166177        conf_lock_system 
    167178        local msg=$(conf_tmp_file) 
     179        local orig_msg=$(conf_tmp_file) 
    168180        local status=$(conf_tmp_file) 
    169181        local modules=$(conf_get_recipe | tr '\n' ',') 
     
    181193        svn status $files >> $status 
    182194        cat $status >> $msg 
     195        cp $msg $orig_msg 
    183196        if [ $(wc -l < $status) -gt 0 ] ; then 
    184197            ${EDITOR} $msg 
    185         fi 
    186         rm $status 
     198            if diff $msg $orig_msg >/dev/null 2>&1 ; then 
     199                echo "Log message unchanged. (a)bort / (C)ontinue?" 
     200                read response 
     201                if [ "${response}" = "a" ] ; then 
     202                    conf_unlock_wcopy 
     203                    conf_unlock_system 
     204                    return 1 
     205                fi 
     206            fi 
     207        fi 
     208        rm $status $orig_msg 
    187209        ${sed_cmd} -i '' -e '/'"$ignoreline"'/,$d' $msg 2>/dev/null 
    188210        $SUDO ${SUDO:+-v} 
Note: See TracChangeset for help on using the changeset viewer.