[meld/VersionControlRework: 46/123] vc: Make all VCs show all columns, since there's only one extra
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/VersionControlRework: 46/123] vc: Make all VCs show all columns, since there's only one extra
- Date: Sun, 19 Apr 2015 20:09:51 +0000 (UTC)
commit d2f9f81799b3771205968f33aa5290a1cbb625da
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Mar 24 06:19:53 2015 +1000
vc: Make all VCs show all columns, since there's only one extra
Having selectably showable columns made sense when we included very
specific columns like 'revision', but we now lump all extra metadata
together in a single column, making it pointless to have visibility
control.
meld/vc/__init__.py | 1 -
meld/vc/_vc.py | 4 ----
meld/vc/bzr.py | 2 --
meld/vc/git.py | 2 --
meld/vc/svn.py | 2 --
meld/vcview.py | 20 +++++---------------
6 files changed, 5 insertions(+), 26 deletions(-)
---
diff --git a/meld/vc/__init__.py b/meld/vc/__init__.py
index 79ac3a4..b710cb4 100644
--- a/meld/vc/__init__.py
+++ b/meld/vc/__init__.py
@@ -25,7 +25,6 @@
import importlib
from . import _null
-from ._vc import DATA_NAME, DATA_STATE, DATA_OPTIONS
# FIXME: This is a horrible hack to help cx_Freeze pick up these plugins when
# freezing the distributable package.
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index c5faff9..3c96c39 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -48,8 +48,6 @@ CONFLICT_THIS = CONFLICT_LOCAL
conflicts = [_("Merged"), _("Base"), _("Local"), _("Remote")]
assert len(conflicts) == CONFLICT_MAX
-DATA_NAME, DATA_STATE, DATA_REVISION, DATA_OPTIONS = list(range(4))
-
# Lifted from the itertools recipes section
def partition(pred, iterable):
@@ -102,8 +100,6 @@ class Vc(object):
VC_ROOT_WALK = True
VC_METADATA = None
- VC_COLUMNS = (DATA_NAME, DATA_STATE)
-
def __init__(self, path):
# Save the requested comparison location. The location may be a
# sub-directory of the repository we are diffing and can be useful in
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index 5dcc804..073f65a 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -50,8 +50,6 @@ class Vc(_vc.Vc):
_vc.STATE_MODIFIED, _vc.STATE_RENAMED, _vc.STATE_NEW, _vc.STATE_REMOVED
)
- VC_COLUMNS = (_vc.DATA_NAME, _vc.DATA_STATE, _vc.DATA_OPTIONS)
-
conflict_map = {
_vc.CONFLICT_BASE: '.BASE',
_vc.CONFLICT_OTHER: '.OTHER',
diff --git a/meld/vc/git.py b/meld/vc/git.py
index 7634dbc..39c9c79 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -44,8 +44,6 @@ class Vc(_vc.Vc):
NAME = "Git"
VC_DIR = ".git"
- VC_COLUMNS = (_vc.DATA_NAME, _vc.DATA_STATE, _vc.DATA_OPTIONS)
-
GIT_DIFF_FILES_RE = ":(\d+) (\d+) [a-z0-9]+ [a-z0-9]+ ([XADMTU])\t(.*)"
DIFF_RE = re.compile(GIT_DIFF_FILES_RE)
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index 19738e0..e49f0ee 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -41,8 +41,6 @@ class Vc(_vc.Vc):
NAME = "Subversion"
VC_DIR = ".svn"
- VC_COLUMNS = (_vc.DATA_NAME, _vc.DATA_STATE, _vc.DATA_OPTIONS)
-
state_map = {
"unversioned": _vc.STATE_NONE,
"added": _vc.STATE_NEW,
diff --git a/meld/vcview.py b/meld/vcview.py
index 9d342ae..953348f 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -198,7 +198,6 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.model.treeview_search_cb, None)
self.current_path, self.prev_path, self.next_path = None, None, None
- self.column_name_map = {}
col_index = self.model.column_index
column = Gtk.TreeViewColumn(_("Name"))
column.set_resizable(True)
@@ -215,24 +214,21 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
style=col_index(tree.COL_STYLE, 0),
weight=col_index(tree.COL_WEIGHT, 0),
strikethrough=col_index(tree.COL_STRIKE, 0))
- column_index = self.treeview.append_column(column) - 1
- self.column_name_map[vc.DATA_NAME] = column_index
+ self.treeview.append_column(column)
- def addCol(name, num, data_name=None):
+ def addCol(name, num):
column = Gtk.TreeViewColumn(name)
column.set_resizable(True)
rentext = Gtk.CellRendererText()
column.pack_start(rentext, True)
column.set_attributes(rentext,
markup=self.model.column_index(num, 0))
- column_index = self.treeview.append_column(column) - 1
- if data_name:
- self.column_name_map[data_name] = column_index
+ self.treeview.append_column(column)
return column
self.treeview_column_location = addCol(_("Location"), COL_LOCATION)
- addCol(_("Status"), COL_STATUS, vc.DATA_STATE)
- addCol(_("Extra"), COL_OPTIONS, vc.DATA_OPTIONS)
+ addCol(_("Status"), COL_STATUS)
+ addCol(_("Extra"), COL_OPTIONS)
self.consolestream = ConsoleStream(self.consoleview)
self.location = None
@@ -277,11 +273,6 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self._set_external_action_sensitivity(False)
super(VcView, self).on_container_switch_out_event(ui)
- def update_visible_columns(self):
- for data_id in self.column_name_map:
- col = self.treeview.get_column(self.column_name_map[data_id])
- col.set_visible(data_id in self.vc.VC_COLUMNS)
-
def update_actions_sensitivity(self):
"""Disable actions that use not implemented VC plugin methods"""
valid_vc_actions = ["VcDeleteLocally"]
@@ -370,7 +361,6 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.vc = cb.get_model()[cb.get_active_iter()][1]
self._set_location(self.vc.location)
self.update_actions_sensitivity()
- self.update_visible_columns()
def set_location(self, location):
self.choose_vc(location)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]