more coloring
This commit is contained in:
52
bin/hgmenu
52
bin/hgmenu
@@ -27,25 +27,31 @@ done
|
||||
PRC="cat"
|
||||
hash highbeam 2> /dev/null && PRC="highbeam"
|
||||
export HB_RULES='"^\[.\]" "$G" \
|
||||
"|.*|" "$W" \
|
||||
"^#\s.*" "$Y" \
|
||||
'
|
||||
COLORED=0
|
||||
grep -q "color\s*=" ~/.hgrc && {
|
||||
COLORED=1
|
||||
COLORSTR="--color always"
|
||||
}
|
||||
echo '# Mercurial:
|
||||
|
||||
echo 'Mercurial:
|
||||
[a] | Add | files to track*
|
||||
[c] | Commit | changes to local repository
|
||||
[d] | Difference | of current and previous versions
|
||||
[l] | Log |
|
||||
[m] | Merge | conflicting change sets
|
||||
[p] | Pull | changes from remote repository
|
||||
[P] | Push | changes to remote repository
|
||||
[r] | Remove | files*
|
||||
[u] | Update | from local repository
|
||||
[s] | Status |
|
||||
[t] | Thg | X repository viewer
|
||||
[v] | View | internal X viewer
|
||||
|
||||
[a] Add files to track*
|
||||
[c] Commit changes to local repository
|
||||
[d] Difference of current and previous versions
|
||||
[l] Log
|
||||
[m] Merge conflicting change sets
|
||||
[p] Pull changes from remote repository
|
||||
[P] Push changes to remote repository
|
||||
[r] Remove files*
|
||||
[u] Update from local repository
|
||||
[s] Status
|
||||
[t] Start thg, graphical repository viewer
|
||||
[v] View, internal graphical viewer
|
||||
|
||||
[X] Add the required extensions to your ~/.hgrc
|
||||
[q] Quit
|
||||
[X] | Install | color and view extensions to your ~/.hgrc
|
||||
[q] | Quit |
|
||||
|
||||
* Requires arguments
|
||||
' | $PRC
|
||||
@@ -68,16 +74,16 @@ case "$CMD" in
|
||||
find "$@" \( -type d -name .hg -prune \) -o -type f -print
|
||||
}
|
||||
[[ -z "$@" ]] && {
|
||||
hg status -mard
|
||||
hg status -mard $COLORSTR
|
||||
}
|
||||
read -e -p "Commit message: " MSG
|
||||
hg commit -m "$MSG" "$@"
|
||||
;;
|
||||
d)
|
||||
hg diff --color always "$@"| $LESS
|
||||
hg diff $COLORSTR "$@" | $LESS
|
||||
;;
|
||||
l)
|
||||
hg log -G --color always "$@" | $LESS
|
||||
hg log -G $COLORSTR "$@" | $LESS
|
||||
;;
|
||||
m)
|
||||
hg merge "$@"
|
||||
@@ -99,7 +105,7 @@ case "$CMD" in
|
||||
hg update "$@"
|
||||
;;
|
||||
s)
|
||||
hg status --color always "$@" | $LESS
|
||||
hg status $COLORSTR "$@" | $LESS
|
||||
;;
|
||||
t)
|
||||
thg "$@"&
|
||||
@@ -115,15 +121,17 @@ case "$CMD" in
|
||||
grep -q "^[extensions]" ~/.hgrc && {
|
||||
sed '0,/^\[extensions\]/s//[extensions]\ncolor=/' ~/.hgrc
|
||||
} || {
|
||||
echo -e "[extensions]\ncolor="
|
||||
echo -e "[extensions]\ncolor=" >> ~/.hgrc
|
||||
}
|
||||
echo "Added color support"
|
||||
}
|
||||
grep -q "hgk\s*=" ~/.hgrc || {
|
||||
grep -q "^[extensions]" ~/.hgrc && {
|
||||
sed '0,/^\[extensions\]/s//[extensions]\nhgk=/' ~/.hgrc
|
||||
} || {
|
||||
echo -e "[extensions]\nhgk="
|
||||
echo -e "[extensions]\nhgk=" >> ~/.hgrc
|
||||
}
|
||||
echo "Added X view support"
|
||||
}
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user