From 9d51e7c27875fa0bb4aeba074724885a14d9f5ac Mon Sep 17 00:00:00 2001 From: Christophe Huriaux Date: Wed, 28 Aug 2019 12:10:45 +0200 Subject: [PATCH] Fixes b-ryan#408 --- powerline_shell/segments/svn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/powerline_shell/segments/svn.py b/powerline_shell/segments/svn.py index 6869cf9c..99dcc655 100644 --- a/powerline_shell/segments/svn.py +++ b/powerline_shell/segments/svn.py @@ -7,6 +7,8 @@ def _get_svn_revision(): stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=get_subprocess_env()) + + revision = None for line in p.communicate()[0].decode("utf-8").splitlines(): if "revision" in line: revision = line.split("=")[1].split('"')[1] @@ -66,5 +68,7 @@ def add_to_powerline(self): symbol = " " + RepoStats().symbols["svn"] else: symbol = "" - self.powerline.append(symbol + " rev " + self.revision + " ", fg, bg) + + if self.revision: + self.powerline.append(symbol + " rev " + self.revision + " ", fg, bg) self.stats.add_to_powerline(self.powerline)