[meld] Add "mark as resolved" VC action & buttons
- From: Vincent Legoll <vincele src gnome org>
- To: svn-commits-list gnome org
- Subject: [meld] Add "mark as resolved" VC action & buttons
- Date: Fri, 1 May 2009 04:55:18 -0400 (EDT)
commit 95b423887c59b89659f40e756daf4edf7c2c854c
Author: Vincent Legoll <vincent legoll gmail com>
Date: Fri May 1 10:48:33 2009 +0200
Add "mark as resolved" VC action & buttons
Rediffing the patch from Matthijs van de Water from
the bug 403193 - Can't resolve subversion conflicts
And updating it to current meld code
---
glade2/vcview-ui.xml | 2 ++
vc/_null.py | 2 ++
vc/_vc.py | 2 ++
vc/bzr.py | 2 ++
vc/darcs.py | 4 ++++
vc/monotone.py | 2 ++
vc/svn.py | 2 ++
vcview.py | 6 +++++-
8 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/glade2/vcview-ui.xml b/glade2/vcview-ui.xml
index b01261f..783b729 100644
--- a/glade2/vcview-ui.xml
+++ b/glade2/vcview-ui.xml
@@ -21,6 +21,7 @@
<toolitem action="VcCommit" />
<toolitem action="VcUpdate" />
<toolitem action="VcAdd" />
+ <toolitem action="VcResolved" />
<toolitem action="VcRemove" />
<toolitem action="VcRevert" />
<toolitem action="VcDeleteLocally" />
@@ -43,6 +44,7 @@
<separator/>
<menuitem action="VcAdd" />
<menuitem action="VcAddBinary" />
+ <menuitem action="VcResolved" />
<menuitem action="VcRemove" />
<menuitem action="VcRevert" />
<separator/>
diff --git a/vc/_null.py b/vc/_null.py
index e925b09..0478fb9 100644
--- a/vc/_null.py
+++ b/vc/_null.py
@@ -43,6 +43,8 @@ class Vc(_vc.Vc):
return [self.CMD,"rm","-f"]
def revert_command(self):
return [self.CMD,"update","-C"]
+ def resolved_command(self):
+ return [self.CMD,"resolved"]
def lookup_files(self, dirs, files):
"files is array of (name, path). assume all files in same dir"
diff --git a/vc/_vc.py b/vc/_vc.py
index 248e4fa..c16cdef 100644
--- a/vc/_vc.py
+++ b/vc/_vc.py
@@ -92,6 +92,8 @@ class Vc(object):
raise NotImplementedError()
def revert_command(self):
raise NotImplementedError()
+ def resolved_command(self):
+ raise NotImplementedError()
def patch_command(self, workdir):
return ["patch","--strip=%i"%self.PATCH_STRIP_NUM,"--reverse","--directory=%s" % workdir]
diff --git a/vc/bzr.py b/vc/bzr.py
index 4a043cf..d52e454 100644
--- a/vc/bzr.py
+++ b/vc/bzr.py
@@ -54,6 +54,8 @@ class Vc(_vc.CachedVc):
return [self.CMD,"rm"]
def revert_command(self):
return [self.CMD,"revert"]
+ def resolved_command(self):
+ return [self.CMD,"resolve"]
def get_working_directory(self, workdir):
return self.root
diff --git a/vc/darcs.py b/vc/darcs.py
index 807ccf3..f480000 100644
--- a/vc/darcs.py
+++ b/vc/darcs.py
@@ -66,6 +66,10 @@ class Vc(_vc.CachedVc):
# will not work, since darcs needs interaction it seems
return [self.CMD, "revert", "-a"]
+ def resolved_command(self):
+ # untested
+ return [self.CMD, "resolve"]
+
def get_working_directory(self, workdir):
return self.root
diff --git a/vc/monotone.py b/vc/monotone.py
index 0825917..703eafb 100644
--- a/vc/monotone.py
+++ b/vc/monotone.py
@@ -142,6 +142,8 @@ class Vc(_vc.CachedVc):
return [self.CMD,"drop"]
def revert_command(self):
return [self.CMD,"revert"]
+ def resolved_command(self):
+ return [self.CMD,"resolved"]
def get_working_directory(self, workdir):
return self.root
diff --git a/vc/svn.py b/vc/svn.py
index 8626bed..f0ca21e 100644
--- a/vc/svn.py
+++ b/vc/svn.py
@@ -61,6 +61,8 @@ class Vc(_vc.Vc):
return [self.CMD,"rm","--force"]
def revert_command(self):
return [self.CMD,"revert"]
+ def resolved_command(self):
+ return [self.CMD,"resolved"]
def _get_matches(self, directory):
"""return a list of tuples (file_path, status_code, revision)"""
diff --git a/vcview.py b/vcview.py
index 434790e..ddedd97 100644
--- a/vcview.py
+++ b/vcview.py
@@ -112,6 +112,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
"VcUpdate": ("update_command", ()),
"VcAdd": ("add_command", ()),
"VcAddBinary": ("add_command", ()),
+ "VcResolved": ("resolved_command", ()),
"VcRemove": ("remove_command", ()),
"VcRevert": ("revert_command", ()),
}
@@ -128,6 +129,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
("VcAdd", "vc-add-24", _("_Add"), None, _("Add to VC"), self.on_button_add_clicked), # FIXME: popup used to use gtk.STOCK_ADD
("VcAddBinary", gtk.STOCK_ADD, _("Add _Binary"), None, _("Add binary to VC"), self.on_button_add_binary_clicked), # FIXME: stock is inconsistent with other VC actions
("VcRemove", "vc-remove-24", _("_Remove"), None, _("Remove from VC"), self.on_button_remove_clicked), # FIXME: popup used to use gtk.STOCK_REMOVE
+ ("VcResolved", gtk.STOCK_CLEAR, _("_Resolved"), None, _("Mark as resolved for VC"), self.on_button_resolved_clicked),
("VcRevert", gtk.STOCK_REVERT_TO_SAVED, None, None, _("Revert to original"), self.on_button_revert_clicked),
("VcDeleteLocally", gtk.STOCK_DELETE, None, None, _("Delete locally"), self.on_button_delete_clicked), # FIXME: popup label was "_Remove locally"
)
@@ -150,7 +152,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self.actiongroup.get_action(action).props.is_important = True
for action in ("VcCommit", "VcUpdate", "VcAdd", "VcRemove",
"VcShowModified", "VcShowNormal", "VcShowNonVC",
- "VcShowIgnored"):
+ "VcShowIgnored", "VcResolved"):
button = self.actiongroup.get_action(action)
button.props.icon_name = button.props.stock_id
self.tempdirs = []
@@ -448,6 +450,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
self._command_on_selected(self.vc.add_command(binary=1))
def on_button_remove_clicked(self, obj):
self._command_on_selected(self.vc.remove_command())
+ def on_button_resolved_clicked(self, obj):
+ self._command_on_selected(self.vc.resolved_command())
def on_button_revert_clicked(self, obj):
self._command_on_selected(self.vc.revert_command())
def on_button_delete_clicked(self, obj):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]