[meld] vcview: Hand off some labelling metadata from VC to file comparisons



commit d42e6563f01306a9e8977e1b3e9d626df0758ed0
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Apr 23 10:51:10 2014 +1000

    vcview: Hand off some labelling metadata from VC to file comparisons

 meld/vcview.py |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/meld/vcview.py b/meld/vcview.py
index 85ad449..5445ef1 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -1,3 +1,5 @@
+# coding=UTF-8
+
 # Copyright (C) 2002-2006 Stephen Kennedy <stevek gnome org>
 # Copyright (C) 2010-2013 Kai Willadsen <kai willadsen gmail com>
 #
@@ -484,6 +486,11 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
             return
 
         left_is_local = self.props.left_is_local
+        basename = os.path.basename(path)
+        meta = {
+            'parent': self,
+            'prompt_resolve': False,
+        }
 
         if self.vc.get_entry(path).state == tree.STATE_CONFLICT and \
                 hasattr(self.vc, 'get_path_for_conflict'):
@@ -499,20 +506,23 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
                      for c in conflicts]
             temps = [p for p, is_temp in diffs if is_temp]
             diffs = [p for p, is_temp in diffs]
-            meta = {
-                'parent': self,
-                'prompt_resolve': True,
-            }
             kwargs = {
                 'auto_merge': False,
                 'merge_output': path,
-                'meta': meta,
             }
+            meta['prompt_resolve'] = True
+            meta['labels'] = (
+                _(u"%s — local") % basename, None,
+                _(u"%s — remote") % basename
+            )
         else:
             comp_path = self.vc.get_path_for_repo_file(path)
             temps = [comp_path]
             diffs = [path, comp_path] if left_is_local else [comp_path, path]
             kwargs = {}
+            meta['labels'] = (
+                _(u"%s — local") % basename, None)
+        kwargs['meta'] = meta
 
         for temp_file in temps:
             os.chmod(temp_file, 0o444)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]