[meld] Add push command to UI and unimplemented VC backend support
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Add push command to UI and unimplemented VC backend support
- Date: Mon, 29 Apr 2013 20:19:37 +0000 (UTC)
commit d5ae1a5925eda5ba7865359fdfceff9fb546fdd6
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Apr 27 15:26:09 2013 +1000
Add push command to UI and unimplemented VC backend support
data/ui/vcview-ui.xml | 2 ++
meld/vc/_vc.py | 12 ++++++++++++
meld/vcview.py | 25 ++++++++++++++++---------
3 files changed, 30 insertions(+), 9 deletions(-)
---
diff --git a/data/ui/vcview-ui.xml b/data/ui/vcview-ui.xml
index f78fc5f..001e172 100644
--- a/data/ui/vcview-ui.xml
+++ b/data/ui/vcview-ui.xml
@@ -6,6 +6,7 @@
<menuitem action="VcCompare" />
<menuitem action="VcCommit" />
<menuitem action="VcUpdate" />
+ <menuitem action="VcPush" />
<separator/>
<menuitem action="OpenExternal" />
<separator/>
@@ -37,6 +38,7 @@
<placeholder name="SpecialActions">
<toolitem action="VcCommit" />
<toolitem action="VcUpdate" />
+ <toolitem action="VcPush" />
<toolitem action="VcAdd" />
<toolitem action="VcResolved" />
<toolitem action="VcRemove" />
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index 969182a..d21ed69 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -110,21 +110,33 @@ class Vc(object):
def commit_command(self, message):
raise NotImplementedError()
+
def diff_command(self):
raise NotImplementedError()
+
def update_command(self):
raise NotImplementedError()
+
def add_command(self):
raise NotImplementedError()
+
def remove_command(self, force=0):
raise NotImplementedError()
+
def revert_command(self):
raise NotImplementedError()
+
def resolved_command(self):
raise NotImplementedError()
+
def patch_command(self, workdir):
return ["patch", "-p%i" % self.PATCH_STRIP_NUM, "-R", "-d", workdir]
+ # Prototyping VC interface version 2
+
+ def push(self, runner):
+ raise NotImplementedError()
+
def get_path_for_repo_file(self, path, commit=None):
"""Returns a file path for the repository path at commit
diff --git a/meld/vcview.py b/meld/vcview.py
index 38d1e1f..4429d45 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -177,14 +177,15 @@ entry_ignored = lambda x: (x.state == tree.STATE_IGNORED) or x.isdir
class VcView(melddoc.MeldDoc, gnomeglade.Component):
# Map action names to VC commands and required arguments list
action_vc_cmds_map = {
- "VcCompare": ("diff_command", ()),
- "VcCommit": ("commit_command", ("",)),
- "VcUpdate": ("update_command", ()),
- "VcAdd": ("add_command", ()),
- "VcResolved": ("resolved_command", ()),
- "VcRemove": ("remove_command", ()),
- "VcRevert": ("revert_command", ()),
- }
+ "VcCompare": ("diff_command", ()),
+ "VcCommit": ("commit_command", ("",)),
+ "VcUpdate": ("update_command", ()),
+ "VcPush": ("push", (lambda *args, **kwargs: None, )),
+ "VcAdd": ("add_command", ()),
+ "VcResolved": ("resolved_command", ()),
+ "VcRemove": ("remove_command", ()),
+ "VcRevert": ("revert_command", ()),
+ }
state_actions = {
"flatten": ("VcFlatten", None),
@@ -209,6 +210,9 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
("VcUpdate", "vc-update-24", _("_Update"), None,
_("Update working copy from version control"),
self.on_button_update_clicked),
+ ("VcPush", "vc-push-24", _("_Push"), None,
+ _("Push local changes to remote"),
+ self.on_button_push_clicked),
("VcAdd", "vc-add-24", _("_Add"), None,
_("Add to version control"),
self.on_button_add_clicked),
@@ -252,7 +256,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
for action in ("VcCompare", "VcFlatten", "VcShowModified",
"VcShowNormal", "VcShowNonVC", "VcShowIgnored"):
self.actiongroup.get_action(action).props.is_important = True
- for action in ("VcCommit", "VcUpdate", "VcAdd", "VcRemove",
+ for action in ("VcCommit", "VcUpdate", "VcPush", "VcAdd", "VcRemove",
"VcShowModified", "VcShowNormal", "VcShowNonVC",
"VcShowIgnored", "VcResolved"):
button = self.actiongroup.get_action(action)
@@ -688,6 +692,9 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
except AttributeError:
self._command_on_selected(self.vc.update_command())
+ def on_button_push_clicked(self, obj):
+ self.vc.push(self._command)
+
def on_button_commit_clicked(self, obj):
CommitDialog(self).run()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]