diff options
-rw-r--r-- | ranger/ext/vcs/hg.py | 17 | ||||
-rw-r--r-- | ranger/ext/vcs/vcs.py | 24 |
2 files changed, 13 insertions, 28 deletions
diff --git a/ranger/ext/vcs/hg.py b/ranger/ext/vcs/hg.py index fa74bfb5..cf15e35e 100644 --- a/ranger/ext/vcs/hg.py +++ b/ranger/ext/vcs/hg.py @@ -114,22 +114,7 @@ class Hg(Vcs): def data_status_remote(self): if self._remote_url() is None: return 'none' - - ahead = behind = True - try: - self._run(['outgoing'], catchout=False) - except VcsError: - ahead = False - - try: - self._run(['incoming'], catchout=False) - except VcsError: - behind = False - - if ahead: - return 'diverged' if behind else 'ahead' - else: - return 'behind' if behind else 'sync' + return 'unknown' def data_branch(self): return self._run(['branch']).rstrip('\n') or None diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index 816fad3f..a0f4b5d7 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -160,6 +160,17 @@ class Vcs(object): # pylint: disable=too-many-instance-attributes return (None, None, None, None) + def _status_root(self): + """Returns root status""" + if self.status_subpaths is None: + return 'none' + + statuses = set(status for path, status in self.status_subpaths.items()) + for status in self.DIRSTATUSES: + if status in statuses: + return status + return 'sync' + def init_root(self): """Initialize root cheaply""" try: @@ -245,7 +256,7 @@ class Vcs(object): # pylint: disable=too-many-instance-attributes self.branch = self.data_branch() self.status_subpaths = self.data_status_subpaths() self.obj.vcsremotestatus = self.data_status_remote() - self.obj.vcsstatus = self.status_root() + self.obj.vcsstatus = self._status_root() except VcsError: self.update_tree(purge=True) return False @@ -284,17 +295,6 @@ class Vcs(object): # pylint: disable=too-many-instance-attributes return True return False - def status_root(self): - """Returns root status""" - if self.status_subpaths is None: - return 'none' - - statuses = set(status for path, status in self.status_subpaths.items()) - for status in self.DIRSTATUSES: - if status in statuses: - return status - return 'sync' - def status_subpath(self, path, is_directory=False): """ Returns the status of path |