[meld] Show error if user tries to compare four directories (closes bgo#650741)



commit 58f2a8e3b9bcc677a9c7e4699f7519562e72c1e6
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue May 24 07:38:32 2011 +1000

    Show error if user tries to compare four directories (closes bgo#650741)

 meld/meldapp.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index c4d7238..feb11ab 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -177,8 +177,12 @@ class MeldApp(gobject.GObject):
         options, args = parser.parse_args(rawargs)
         if len(args) > 4:
             parser.error(_("too many arguments (wanted 0-4, got %d)") % len(args))
+        elif len(args) == 4 and any([os.path.isdir(f) for f in args]):
+            parser.error(_("can't compare more than three directories"))
 
         for files in options.diff:
+            if len(files) == 4 and any([os.path.isdir(f) for f in files]):
+                parser.error(_("can't compare more than three directories"))
             self.window.open_paths(files)
 
         tab = self.window.open_paths(args, options.auto_compare)



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