diff options
author | nfnty <git@nfnty.se> | 2016-08-08 19:38:30 +0200 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-08-08 19:38:41 +0200 |
commit | 1a2145bb3a605c52c25b3b54b15351b6bae922a9 (patch) | |
tree | 28b6ba8e8e10531b3f9241471002ad9ae713fbbc /ranger/ext/vcs/svn.py | |
parent | 586021c0450593172827d54b766c70f692ef253b (diff) | |
download | ranger-1a2145bb3a605c52c25b3b54b15351b6bae922a9.tar.gz |
VCS: Add _run rstrip_newline
Ensure that only one newline is rstripped
Diffstat (limited to 'ranger/ext/vcs/svn.py')
-rw-r--r-- | ranger/ext/vcs/svn.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/ranger/ext/vcs/svn.py b/ranger/ext/vcs/svn.py index 1813f857..1f09cd52 100644 --- a/ranger/ext/vcs/svn.py +++ b/ranger/ext/vcs/svn.py @@ -36,7 +36,7 @@ class SVN(Vcs): args += ['--'] + filelist try: - output = self._run(args).rstrip('\n') + output = self._run(args) except VcsError: return None if not output: @@ -66,7 +66,7 @@ class SVN(Vcs): def _remote_url(self): """Remote url""" try: - output = self._run(['info', '--xml']).rstrip('\n') + output = self._run(['info', '--xml']) except VcsError: return None if not output: @@ -86,7 +86,7 @@ class SVN(Vcs): if filelist: args += filelist else: - args += self.rootvcs.status_subpaths.keys() + args += self.rootvcs.status_subpaths.keys() # pylint: disable=no-member self._run(args, catchout=False) # Data Interface @@ -95,10 +95,10 @@ class SVN(Vcs): statuses = set() # Paths with status - output = self._run(['status']).rstrip('\n') - if not output: + lines = self._run(['status']).split('\n') + if not lines: return 'sync' - for line in output.split('\n'): + for line in lines: code = line[0] if code == ' ': continue @@ -113,13 +113,12 @@ class SVN(Vcs): statuses = {} # Paths with status - output = self._run(['status']).rstrip('\n') - if output: - for line in output.split('\n'): - code, path = line[0], line[8:] - if code == ' ': - continue - statuses[os.path.normpath(path)] = self._status_translate(code) + lines = self._run(['status']).split('\n') + for line in lines: + code, path = line[0], line[8:] + if code == ' ': + continue + statuses[os.path.normpath(path)] = self._status_translate(code) return statuses |