diff options
author | nfnty <git@nfnty.se> | 2015-10-07 21:34:56 +0200 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2016-02-08 04:43:03 +0100 |
commit | 14a16a1ecef761f22ffcd0ea88128ab5a568353f (patch) | |
tree | cd4801427fcd6b8ec0a092f610ee9dc1b2c9cc0b /ranger | |
parent | 96dd8db40de076e751adcba65931b981438c1de2 (diff) | |
download | ranger-14a16a1ecef761f22ffcd0ea88128ab5a568353f.tar.gz |
VCS: Change vcsfilestatus to vcspathstatus, Fix remotestatus
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/directory.py | 2 | ||||
-rw-r--r-- | ranger/container/fsobject.py | 2 | ||||
-rw-r--r-- | ranger/ext/vcs/vcs.py | 6 | ||||
-rw-r--r-- | ranger/gui/widgets/__init__.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 10 | ||||
-rw-r--r-- | ranger/gui/widgets/statusbar.py | 4 |
6 files changed, 15 insertions, 11 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py index 486507b9..0cf2b528 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -346,7 +346,7 @@ class Directory(FileSystemObject, Accumulator, Loadable): item.load() disk_usage += item.size if self.settings.vcs_aware and self.vcs.root: - item.vcsfilestatus = self.vcs.get_path_status(item.path) + item.vcspathstatus = self.vcs.get_path_status(item.path) files.append(item) self.percent = 100 * len(files) // len(filenames) diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py index e396a75a..1a33f1c4 100644 --- a/ranger/container/fsobject.py +++ b/ranger/container/fsobject.py @@ -73,7 +73,7 @@ class FileSystemObject(FileManagerAware, SettingsAware): size = 0 - vcsfilestatus = None + vcspathstatus = None basename_is_rel_to = None diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index ac996ef4..828ecf14 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -154,14 +154,14 @@ class Vcs(object): self.remotestatus = self.get_remote_status() self.status = self.get_status_allfiles() self.ignored = self.get_ignore_allfiles() - directoryobject.vcsfilestatus = self.get_root_status() + directoryobject.vcspathstatus = self.get_root_status() else: root = directoryobject.fm.get_directory(self.root) self.head = root.vcs.head = root.vcs.get_info(root.vcs.HEAD) self.branch = root.vcs.branch = root.vcs.get_branch() self.status = root.vcs.status = root.vcs.get_status_allfiles() self.ignored = root.vcs.ignored = root.vcs.get_ignore_allfiles() - directoryobject.vcsfilestatus = root.vcs.get_path_status( + directoryobject.vcspathstatus = root.vcs.get_path_status( self.path, is_directory=True) def update_child(self, directoryobject): @@ -171,7 +171,7 @@ class Vcs(object): self.branch = root.vcs.branch self.status = root.vcs.status self.ignored = root.vcs.ignored - directoryobject.vcsfilestatus = root.vcs.get_path_status( + directoryobject.vcspathstatus = root.vcs.get_path_status( self.path, is_directory=True) # Repo creation diff --git a/ranger/gui/widgets/__init__.py b/ranger/gui/widgets/__init__.py index bd0f2337..a1b4c289 100644 --- a/ranger/gui/widgets/__init__.py +++ b/ranger/gui/widgets/__init__.py @@ -5,7 +5,7 @@ from ranger.gui.displayable import Displayable class Widget(Displayable): """A class for classification of widgets.""" - vcsfilestatus_symb = {'conflict': ('X', ["vcsconflict"]), + vcspathstatus_symb = {'conflict': ('X', ["vcsconflict"]), 'untracked': ('+', ["vcschanged"]), 'deleted': ('-', ["vcschanged"]), 'changed': ('*', ["vcschanged"]), diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 8dff30d1..2e31c976 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -257,7 +257,9 @@ class BrowserColumn(Pager): metakey = hash(repr(sorted(metadata.items()))) if metadata else 0 key = (self.wid, selected_i == i, drawn.marked, self.main_column, drawn.path in copied, tagged_marker, drawn.infostring, - drawn.vcsfilestatus, drawn.vcsremotestatus, self.fm.do_cut, + drawn.vcspathstatus, + drawn.vcs.remotestatus if drawn.is_directory and drawn.vcs.is_root else None, + self.fm.do_cut, current_linemode.name, metakey) if key in drawn.display_data: @@ -374,12 +376,14 @@ class BrowserColumn(Pager): vcsstring_display = [] directory = drawn if drawn.is_directory else self.target if self.settings.vcs_aware and directory.vcs.root: - if drawn.vcsfilestatus: - vcsstr, vcscol = self.vcsfilestatus_symb[drawn.vcsfilestatus] + if drawn.vcspathstatus: + vcsstr, vcscol = self.vcspathstatus_symb[drawn.vcspathstatus] vcsstring_display.append([vcsstr, ['vcsfile'] + vcscol]) if drawn.is_directory and drawn.vcs.remotestatus: vcsstr, vcscol = self.vcsremotestatus_symb[drawn.vcs.remotestatus] vcsstring_display.append([vcsstr, ['vcsremote'] + vcscol]) + elif self.target.vcs.is_root: + vcsstring_display.append([" ", []]) elif self.target.has_vcschild: vcsstring_display.append([" ", []]) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index d6f2c91c..8e5b0376 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -195,9 +195,9 @@ class StatusBar(Widget): left.add_space() left.add(vcsinfo, 'vcsinfo') - if target.vcsfilestatus: + if target.vcspathstatus: left.add_space() - vcsstr, vcscol = self.vcsfilestatus_symb[target.vcsfilestatus] + vcsstr, vcscol = self.vcspathstatus_symb[target.vcspathstatus] left.add(vcsstr.strip(), 'vcsfile', *vcscol) if directory.vcs.remotestatus: vcsstr, vcscol = self.vcsremotestatus_symb[directory.vcs.remotestatus] |