Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.