Re: Multiple file comparisons



Hi Andrew, can you follow up with a bugzilla issue (there may be a
similar one already)

I like the idea of starting multiple comparisons at once, but I'm not
a fan of magic separators when we could use something like "--diff"
instead.

As regards the mime type issue, we're going to read the files anyway
so perhaps there's a content type sniffer which would do a better job?

Stephen.

On Fri, Aug 29, 2008 at 1:46 PM, Andrew Stribblehill <stribb google com> wrote:
> Sorry, I should have said: please Cc me on replies: I'm not subscribed.
>
> On Fri, Aug 29, 2008 at 13:44, Andrew Stribblehill <stribb google com> wrote:
>> My version control system shells out to a diff application by using
>> the following syntax:
>>
>> <diff_tool> file1.orig file1.new : file2.orig file2.new ...
>>
>> How would you feel about supporting this? I have a patch to meld 1.1.2
>> but it looks as if it is likely to apply trivially to 1.2.
>>
>> $ diff -Naur meldapp.py~ meldapp.py
>> --- meldapp.py~ 2006-05-02 04:46:16.000000000 +0100
>> +++ meldapp.py  2008-08-29 13:19:34.000000000 +0100
>> @@ -799,6 +799,7 @@
>>     meld <file>                 Start with VC diff of 'file'
>>     meld <file> <file> [file]   Start with 2 or 3 way file comparison
>>     meld <dir>  <dir>  [dir]    Start with 2 or 3 way directory comparison
>> +    meld <f> <f> [<f>] : <f> <f> ...  Start with multiple comparisons open
>>
>>  Options:
>>     -h, --help                  Show this help text and exit
>> @@ -855,11 +856,21 @@
>>             doc.run_diff([a])
>>         else:
>>             app.append_vcview( [a] )
>> -
>> +
>>     elif len(args) in (2,3):
>>         app.append_diff(args)
>> +    elif ":" in args:
>> +        # Args are of the form:
>> +        #   file1a file1b : file2a file2b : ...
>> +        argset = []
>> +        for arg in args:
>> +            if arg != ':':
>> +                argset.append(arg)
>> +            else:
>> +                if argset:
>> +                    app.append_diff(argset)
>> +                argset = []
>>     else:
>>         app.usage( _("Wrong number of arguments (Got %i)") % len(args))
>>
>>     app.main()
>> -
>>
>>
>> I should also like both sides of the diff to see syntax hilighting,
>> but when called with arguments like:
>>
>> $ meld /tmp/foo.cc#4 foo.cc
>>
>> this does not happen for two reasons:
>> 1. gnomevfs.get_mime_type('tmp/foo.cc#4') says it can't read the file.
>> Turns out you have to url-quote it. However...
>> 2. gnomevfs.get_mime_type(urllib.quote('tmp/foo.cc#4')) returns
>> text/plain -- presumably because it can't tell C++ when it sees it and
>> relies just on the file extension.
>>
>> Can anyone suggest a good way around this?
>>
>> --
>> Animal, Animal, Bug, Mikey growls, Mikey purrs, ~Animal, Gary purrs, Mikey
>> purrs, ~Animal, ~Animal, Gary purrs, Mikey growls, ~Bug, ~Animal, ~Animal
>>
>
>
>
> --
> Animal, Animal, Bug, Mikey growls, Mikey purrs, ~Animal, Gary purrs, Mikey
> purrs, ~Animal, ~Animal, Gary purrs, Mikey growls, ~Bug, ~Animal, ~Animal
> _______________________________________________
> meld-list mailing list
> meld-list gnome org
> http://mail.gnome.org/mailman/listinfo/meld-list
>


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