summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2016-02-08 15:21:51 +0100
committernfnty <git@nfnty.se>2016-02-08 15:21:51 +0100
commit878f0f574ca96c6e19c86765159d6ce40084f741 (patch)
tree4679f9dc8ff40591e35a6ffa5e49d849ab3a03de
parentafd2850957a21d68fc2843eba5e4b45263e08a0d (diff)
downloadranger-878f0f574ca96c6e19c86765159d6ce40084f741.tar.gz
VCS: hg: Disable remote status due to performance issues
-rw-r--r--ranger/ext/vcs/hg.py17
-rw-r--r--ranger/ext/vcs/vcs.py24
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