diff --git a/powerline_shell/segments/svn.py b/powerline_shell/segments/svn.py index 6869cf9..339d959 100644 --- a/powerline_shell/segments/svn.py +++ b/powerline_shell/segments/svn.py @@ -16,13 +16,24 @@ def _get_svn_revision(): def parse_svn_stats(status): stats = RepoStats() + onlyIgnored = True for line in status: if line[0] == "?": stats.new += 1 + onlyIgnored = False elif line[0] == "C": stats.conflicted += 1 - elif line[0] in ["A", "D", "I", "M", "R", "!", "~"]: + onlyIgnored = False + elif line[0] in ["A", "D", "M", "R", "!", "~"]: stats.changed += 1 + onlyIgnored = False + elif line [0] == "I": + stats.changed += 1 + + # Ingored if only ignored files + if onlyIgnored: + return None + return stats @@ -45,6 +56,8 @@ def build_stats(): return None, None status = _get_svn_status(pdata) stats = parse_svn_stats(status) + if stats == None: + return None, None revision = _get_svn_revision() return stats, revision