mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
increased speed of hg segment by checking for .hg-dir first
This commit is contained in:
parent
25bb4db5bd
commit
922cedbf54
|
|
@ -44,6 +44,15 @@ def _get_hg_status(output):
|
|||
|
||||
|
||||
def build_stats():
|
||||
# check if we are in a hg dir
|
||||
path = '/'
|
||||
for p in os.getenv("PWD").split('/'):
|
||||
path += p + '/'
|
||||
if os.path.isdir(path+'.hg'):
|
||||
break
|
||||
else:
|
||||
return None, None
|
||||
|
||||
try:
|
||||
p = subprocess.Popen(["hg", "status"],
|
||||
stdout=subprocess.PIPE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue