<commit_before># This checks if the current branch is ahead of
# or behind the remote branch with which it is tracked

# Source lib to get the function get_tmux_pwd
source "${TMUX_POWERLINE_DIR_HOME}/lib/tmux_adapter.sh"

mod_symbol="﹢"

run_segment() {
	tmux_path=$(get_tmux_cwd)
	cd "$tmux_path"

	stats=""
	if [ -n "${git_stats=$(__parse_git_stats)}" ]; then
    	stats="$git_stats"
	elif [ -n "${svn_stats=$(__parse_svn_stats)}" ]; then
    	stats="$svn_stats"
	elif [ -n "${hg_stats=$(__parse_hg_stats)}" ]; then
    	stats="$hg_stats"
	fi
	if [[ -n "$stats" ]]; then
    	echo "${stats}"
	fi
}

__parse_git_stats(){
	type git >/dev/null 2>&1
	if [ "$?" -ne 0 ]; then
		return
	fi

    # check if git
    [[ -z $(git rev-parse --git-dir 2> /dev/null) ]] && return

    # return the number of staged items
    staged=$(git ls-files --modified | wc -l)
    echo $staged
}
__parse_hg_stats(){
	type hg >/dev/null 2>&1<commit_msg>Fixed if statement that was broken in 80a79c1e56.<commit_after># This checks if the current branch is ahead of
# or behind the remote branch with which it is tracked

# Source lib to get the function get_tmux_pwd
source "${TMUX_POWERLINE_DIR_HOME}/lib/tmux_adapter.sh"

mod_symbol="﹢"

run_segment() {
	tmux_path=$(get_tmux_cwd)
	cd "$tmux_path"

	stats=""
	if [ -n "${git_stats=$(__parse_git_stats)}" ]; then
    	stats="$git_stats"
	elif [ -n "${svn_stats=$(__parse_svn_stats)}" ]; then
    	stats="$svn_stats"
	elif [ -n "${hg_stats=$(__parse_hg_stats)}" ]; then
    	stats="$hg_stats"
	fi
	if [[ -n "$stats" && $stats -gt 0 ]]; then
		echo "${mod_symbol}${stats}"
	fi
}

__parse_git_stats(){
	type git >/dev/null 2>&1
	if [ "$?" -ne 0 ]; then
		return
	fi

    # check if git
    [[ -z $(git rev-parse --git-dir 2> /dev/null) ]] && return

    # return the number of staged items
    staged=$(git ls-files --modified | wc -l)
    echo $staged
}
__parse_hg_stats(){
	type hg >/dev/null 2>&1
{'fraction_non_alphanumeric': 0.16112266112266113, 'fraction_numerical': 0.010395010395010396, 'mean_word_length': 3.616306954436451, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7524101', 'n_tokens_mistral': 774, 'n_tokens_neox': 739, 'n_words': 203}