Skip to content

Instantly share code, notes, and snippets.

@raimon49
Created March 20, 2012 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raimon49/2132555 to your computer and use it in GitHub Desktop.
Save raimon49/2132555 to your computer and use it in GitHub Desktop.
Take2: 日本語設定でhg commit時にvimで差分を見ながら入力するパッチ(最新版との差分 + 恥ずかしいデバッグプリントを削除)
--- 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