[chirp_devel] [developer] Add diffs-only mode to file diff utility - #1699

Dan Smith
Mon Jul 7 14:22:27 PDT 2014


> # HG changeset patch
> # User Dan Drogichen <chirp.cordless at xoxy.net>
> # Date 1403149386 25200
> #      Wed Jun 18 20:43:06 2014 -0700
> # Node ID d03df310f7ae9734ee1a78128d062f334f81114b
> # Parent  293cf2f7da0fa9d4000faf71bf8b4872f78f0bb1
> [developer] Add diffs-only mode to file diff utility - #1699
> 
> Adds an alternate display mode to the developer tools dump/diff utility
> in which only lines which are different are printed. Ranges of one or
> more lines that do not differ are replaced with a single blank line.

Man, I *really* don't understand why this is a better way to look at it,
but maybe I've been looking at real diffs for too long :)

> This mode is invoked by setting the first memory location in the
> "Diff Radios" popup to -2. The existing functionality invoked by -1
> is not affected.

Hmm, setting one of them to -2 and the other to what? The point of the
first/second box is so that you can diff two different memory locations
in two images. Does this enable only diffing two corresponding locations
in this special mode?

How about we just add another entry to the menu so that we have "Diff
memories" and "Naked diff memories" (or some other name that conveys
what we're talking about.

> +    blankprinted = True
>      for line in lines:
>          if line.startswith("-"):
>              tags = ("red", "bold")
>          elif line.startswith("+"):
>              tags = ("blue", "bold")
> +            blankprinted = False
> +        elif diffsonly == True:
> +            if blankprinted:
> +                continue
> +            else:
> +                line = ""
> +                tags = ()
> +                blankprinted = True

This is really confusing. Is the point to ensure that after a + line you
get a blank line? Regardless, doing this in the display routine seems
like the wrong place to do this. Why not modify common.simple_diff() to
generate what you want in the first place?

--Dan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 538 bytes
Desc: OpenPGP digital signature
Url : http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20140707/6bf9e128/attachment-0001.bin 


More information about the chirp_devel mailing list