lib/update.hg
branchdns-new
changeset 95 a756f317d083
parent 89 51270237a6ff
child 96 bed4765fc56f
equal deleted inserted replaced
94:1b02d8075676 95:a756f317d083
     8     cmd $HG -R "$repo" "${HG_ARGS[@]}" "$@"
     8     cmd $HG -R "$repo" "${HG_ARGS[@]}" "$@"
     9 }
     9 }
    10 
    10 
    11 ## Does the repo have local modifications?
    11 ## Does the repo have local modifications?
    12 function hg_modified {
    12 function hg_modified {
    13     hg $1 id | grep -q '+'
    13     hg $1 id -i | grep -q '+'
       
    14 }
       
    15 
       
    16 ## Get the date for the current commit as an unix timestamp
       
    17 function hg_time {
       
    18     local repo=$1
       
    19     local hg_unix=
       
    20     local hg_tz=
       
    21 
       
    22     local hg_date=$(hg $repo log -r . --template '{date|hgdate}')
       
    23     local hg_unix=${hg_date% *}
       
    24     local hg_tz=${hg_date#* }
       
    25 
       
    26     [ -n "$hg_unix" ] || fail "failed to read hg time"
       
    27 
       
    28     echo "$hg_unix"
    14 }
    29 }
    15 
    30 
    16 ## Output possible -u flag for commit.
    31 ## Output possible -u flag for commit.
    17 function hg_user {
    32 function hg_user {
    18     if [ ${SUDO_USER:-} ]; then
    33     if [ ${SUDO_USER:-} ]; then