From a3b401127c4c7aca51d32b5e823e6eb77ab6fc91 Mon Sep 17 00:00:00 2001
From: Roman Inflianskas <infroma@gmail.com>
Date: Sat, 22 Nov 2014 14:54:18 +0300
Subject: [PATCH] bobthefish: hg: faster checking for hg repo (fix)

Conflicts:
	themes/bobthefish/fish_prompt.fish
---
 themes/bobthefish/fish_prompt.fish | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/themes/bobthefish/fish_prompt.fish b/themes/bobthefish/fish_prompt.fish
index ad13a49..35d8d17 100644
--- a/themes/bobthefish/fish_prompt.fish
+++ b/themes/bobthefish/fish_prompt.fish
@@ -75,6 +75,17 @@ set __bobthefish_lt_brown   BF5E00
 #   command which hg > /dev/null 2>&1; and command hg stat > /dev/null 2>&1
 # end
 
+function __bobthefish_check_hg_dir_recursively -d 'Check whether pwd or parents contain .hg dir'
+  set d (pwd)
+  while not [ $d = / ]
+    if test -e $d/.hg
+      return 0
+    end
+    set d (dirname $d)
+  end
+  return 1
+end
+
 function __bobthefish_git_branch -d 'Get the current git branch (or commitish)'
   set -l ref (command git symbolic-ref HEAD ^/dev/null)
   if [ $status -gt 0 ]
-- 
GitLab