[PATCH] Fix misleading error message 'Invoking patch failed'



Please review the wording, propose a better error message.

Maybe we could add something to help people wanting to
report such bugs, like something along the lines of:

"""
Please send bug report on meld-list gnome org,
containing the following informations:
[...]
"""
as per the second attached patch.

-- 
Vincent Legoll
Index: vcview.py
===================================================================
--- vcview.py	(revision 1222)
+++ vcview.py	(working copy)
@@ -463,7 +463,10 @@
             for d in diffs:
                 self.emit("create-diff", d)
         else:
-            misc.run_dialog( _("Invoking patch failed, you need GNU patch.")+ "\n'%s'"%" ".join(patchcmd), parent=self)
+            misc.run_dialog(_("Invoking 'patch' failed. ") +
+                            _("Maybe you use an untested version of %s. ") % self.vc.NAME +
+                            _("Or you don't have 'GNU patch' installed.") +
+                            "\n\n'%s'" % " ".join(patchcmd), parent=self)
 
     def refresh(self):
         self.set_location( self.model.value_path( self.model.get_iter_root(), 0 ) )
Index: vcview.py
===================================================================
--- vcview.py	(revision 1222)
+++ vcview.py	(working copy)
@@ -463,7 +463,30 @@
             for d in diffs:
                 self.emit("create-diff", d)
         else:
-            misc.run_dialog( _("Invoking patch failed, you need GNU patch.")+ "\n'%s'"%" ".join(patchcmd), parent=self)
+            import meldapp
+            msg = _("""
+                    Invoking 'patch' failed.
+                    
+                    Maybe you don't have 'GNU patch' installed,
+                    or you use an untested version of %s.
+            
+                    Please send email bug report to:
+                    meld-list gnome org
+                    
+                    Containing the following informations:
+                    
+                    - meld version: '%s'
+                    - source control software type: '%s'
+                    - source control software version: 'X.Y.Z'
+                    - the output of '%s somefile.txt'
+                    - patch command: '%s'
+                    """) % (self.vc.NAME,
+                            meldapp.version,
+                            self.vc.NAME,
+                            " ".join(self.vc.diff_command()),
+                            " ".join(patchcmd))
+            msg = '\n'.join([line.strip() for line in msg.split('\n')])
+            misc.run_dialog(msg, parent=self)
 
     def refresh(self):
         self.set_location( self.model.value_path( self.model.get_iter_root(), 0 ) )


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