hg: remove usage of tail+awk in favor of sed
This commit is contained in:
parent
8df6cffef7
commit
a201e152f7
@ -847,7 +847,8 @@ _lp_hg_branch_color()
|
||||
fi
|
||||
else
|
||||
local has_lines
|
||||
has_lines=$(hg diff --stat 2>/dev/null | tail -n 1 | awk 'FS=" " {printf("+%s/-%s\n", $4, $6)}')
|
||||
# Parse the last line of the diffstat-style output
|
||||
has_lines="$(hg diff --stat 2>/dev/null | sed -n '$ s!^.*, \([0-9]*\) .*, \([0-9]*\).*$!+\1/-\2!p')"
|
||||
if (( commits > 0 )) ; then
|
||||
# Changes to commit and commits to push
|
||||
ret="${LP_COLOR_CHANGES}${branch}${NO_COL}(${LP_COLOR_DIFF}$has_lines${NO_COL},${LP_COLOR_COMMITS}$commits${NO_COL})${has_untracked}${NO_COL}"
|
||||
|
Loading…
Reference in New Issue
Block a user