Fixed diff - this one adds on "/" :-)

Adrian
-- 
bitcube.co.uk - Expert Linux infrastructure consultancy
Puppet, Debian, Red Hat, Ubuntu, CentOS
--- /tmp/meldapp.py	2010-01-28 14:54:14.000000000 +0000
+++ ./meldapp.py	2010-01-29 11:33:38.000000000 +0000
@@ -853,9 +853,13 @@
         aredirs = [ os.path.isdir(p) for p in paths ]
         arefiles = [ os.path.isfile(p) for p in paths ]
         if (1 in aredirs) and (1 in arefiles):
-            misc.run_dialog( _("Cannot compare a mixture of files and directories.\n"),
-                    parent = self,
-                    buttonstype = gtk.BUTTONS_OK)
+            # just find the filename and append it to the directory
+            if os.path.isfile(paths[0]):
+                return self.append_filediff([paths[0],paths[1]
+                         + "/" + os.path.basename(paths[0])])
+            else:
+                return self.append_filediff([paths[1],paths[0]
+                         + "/" + os.path.basename(paths[1])])
         elif 1 in aredirs:
             return self.append_dirdiff(paths, auto_compare)
         else:

Reply via email to