tools/rgit2hg.sh
changeset 11514 5d804405964d
parent 10649 d83897fed816
child 11517 b3ee79e8e3b9
equal deleted inserted replaced
11513:d44d2ab7ce4a 11514:5d804405964d
    24     echo '---------------------------------------------------------------'
    24     echo '---------------------------------------------------------------'
    25     url="https://github.com/hedgewars/hw/commit/$1"
    25     url="https://github.com/hedgewars/hw/commit/$1"
    26     echo "Checking $url ..."
    26     echo "Checking $url ..."
    27     echo
    27     echo
    28     page=$(wget -q -O- "$url")
    28     page=$(wget -q -O- "$url")
    29     author=$(echo "$page" | sed -rn 's/^.*"author-name">(<[^>]*>)*([^ <]*).*/\2/ p')
    29     author=$(echo "$page" | sed -rn '1,/"user-mention"/{s/^.*"user-mention"( *[^>]*)?> *([^ <]*).*$/\2/ p}')
    30     if [ -z "$author" ]; then
    30     if [ -z "$author" ]; then
    31         echo 'Couldn'\''t find author! Skipping '"$1"' ...' >&2
    31         echo 'Couldn'\''t find author! Skipping '"$1"' ...' >&2
    32         shift
    32         shift
    33         continue
    33         continue
    34     fi
    34     fi
    49         shift
    49         shift
    50         continue
    50         continue
    51     fi
    51     fi
    52     rev=$(echo "$result" | sed 's/^.*://;q')
    52     rev=$(echo "$result" | sed 's/^.*://;q')
    53     echo 'Found match: r'"$rev"
    53     echo 'Found match: r'"$rev"
    54     echo 'Link:        https://code.google.com/p/hedgewars/source/detail?r='"$rev"
    54     echo 'Link:        http://hg.hedgewars.org/hedgewars/rev/'"$rev"
    55     echo
    55     echo
    56     echo "$result"
    56     echo "$result"
    57     # proceed to next parameter
    57     # proceed to next parameter
    58     shift
    58     shift
    59 done
    59 done