Created
March 20, 2012 07:38
-
-
Save raimon49/2132555 to your computer and use it in GitHub Desktop.
Take2: 日本語設定でhg commit時にvimで差分を見ながら入力するパッチ(最新版との差分 + 恥ずかしいデバッグプリントを削除)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- hgeditor.latest 2012-08-22 23:08:18.007214610 +0900 | |
+++ hgeditor 2012-08-22 23:08:27.607219725 +0900 | |
@@ -12,11 +12,15 @@ | |
emacs) | |
EDITOR="$EDITOR -nw" | |
;; | |
- gvim|vim) | |
- EDITOR="$EDITOR -f -o" | |
- ;; | |
esac | |
+vim() { | |
+ if [ "$2" ]; then | |
+ "$(which vim)" "+e $2" "+set buftype=help" "+split $1" "+setl ft=svn" | |
+ else | |
+ "$(which vim)" -f -o "$1" | |
+ fi | |
+} | |
HGTMP="" | |
cleanup_exit() { | |
@@ -37,6 +41,9 @@ | |
grep '^HG: changed' "$1" | cut -b 13- | while read changed; do | |
"$HG" diff "$changed" >> "$HGTMP/diff" | |
done | |
+ grep 'を変更$' "$1" | sed 's/ を変更//g' | cut -b 5- | while read changed; do | |
+ "$HG" diff "$changed" >> "$HGTMP/diff" | |
+ done | |
) | |
cat "$1" > "$HGTMP/msg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment