fix script for resolving git commit id to hg commit id (github page format changed; hw hg repo location too)
authorsheepluva
Sat, 16 Jan 2016 19:11:21 +0100
changeset 11519 5d804405964d
parent 11518 d44d2ab7ce4a
child 11520 4dd77731453b
fix script for resolving git commit id to hg commit id (github page format changed; hw hg repo location too)
tools/rgit2hg.sh
--- a/tools/rgit2hg.sh	Fri Jan 15 13:29:27 2016 +0100
+++ b/tools/rgit2hg.sh	Sat Jan 16 19:11:21 2016 +0100
@@ -26,7 +26,7 @@
     echo "Checking $url ..."
     echo
     page=$(wget -q -O- "$url")
-    author=$(echo "$page" | sed -rn 's/^.*"author-name">(<[^>]*>)*([^ <]*).*/\2/ p')
+    author=$(echo "$page" | sed -rn '1,/"user-mention"/{s/^.*"user-mention"( *[^>]*)?> *([^ <]*).*$/\2/ p}')
     if [ -z "$author" ]; then
         echo 'Couldn'\''t find author! Skipping '"$1"' ...' >&2
         shift
@@ -51,7 +51,7 @@
     fi
     rev=$(echo "$result" | sed 's/^.*://;q')
     echo 'Found match: r'"$rev"
-    echo 'Link:        https://code.google.com/p/hedgewars/source/detail?r='"$rev"
+    echo 'Link:        http://hg.hedgewars.org/hedgewars/rev/'"$rev"
     echo
     echo "$result"
     # proceed to next parameter