Re: [chirp_devel] [PATCH] Allow specification of the hexdump address format
On Jul 18, 2014, at 7:58 AM, Dan Smith - dsmith@danplanet.com wrote:
# HG changeset patch ...
Sorry, I'm going to need some help here. First time doing this. I cloned a brand-new repository from d-rats.com. Saved your patch as a text file. The first line is # HG changeset patch the last line is else:
Looks right to me. But I must be missing something, because I get ================ dan[chirp.hg]$ hg import ~/Desktop/dsmith.patch.txt applying /Users/dan/Desktop/dsmith.patch.txt patching file README.developers Hunk #1 FAILED at 18 Hunk #2 FAILED at 39 2 out of 2 hunks FAILED -- saving rejects to file README.developers.rej patching file chirp/util.py Hunk #1 FAILED at 14 1 out of 1 hunks FAILED -- saving rejects to file chirp/util.py.rej patching file chirpui/config.py Hunk #1 FAILED at 35 Hunk #2 FAILED at 64 2 out of 2 hunks FAILED -- saving rejects to file chirpui/config.py.rej patching file chirpui/mainapp.py Hunk #1 FAILED at 223 1 out of 1 hunks FAILED -- saving rejects to file chirpui/mainapp.py.rej abort: patch failed to apply ================
To save some back-and-forth: I'm guessing the patch works for me, but I'd like to test it.
I can give some feedback on the README file by reading the raw patch: - It wouldn't be obvious to me that I can have multiple conversion specs, so an example of: "hexdump_addrfmt = %(addr)03i 0x%(addr)04x prints the address in both decimal and hex" would be useful.
- The fact that %(addr)03i is the default should be stated.
- The first line of the description is intended to be syntax.
+hexdump_addrfmt = %(addr)03i
is not syntax, it's an example. This should be something like hexdump_addrfmt = <python format specification string>
Looking for help on the patch apply.
-dan
Looks right to me. But I must be missing something, because I get
dan[chirp.hg]$ hg import ~/Desktop/dsmith.patch.txt applying /Users/dan/Desktop/dsmith.patch.txt patching file README.developers Hunk #1 FAILED at 18 Hunk #2 FAILED at 39 2 out of 2 hunks FAILED -- saving rejects to file README.developers.rej patching file chirp/util.py Hunk #1 FAILED at 14 1 out of 1 hunks FAILED -- saving rejects to file chirp/util.py.rej patching file chirpui/config.py Hunk #1 FAILED at 35 Hunk #2 FAILED at 64 2 out of 2 hunks FAILED -- saving rejects to file chirpui/config.py.rej patching file chirpui/mainapp.py Hunk #1 FAILED at 223 1 out of 1 hunks FAILED -- saving rejects to file chirpui/mainapp.py.rej abort: patch failed to apply ================
This is saying nothing applied, which generally means that line endings aren't right. I think you're using a mac, which uses \r line endings (sometimes, not always, and I can never remember when/why). My guess would be that you copy-and-paste'd the patch out to a file? In that case, you've got \r endings and the code has \n. Thus, patch (or hg import in this case) can't find any lines that match.
You could try this:
$ cat dsmith.patch.txt | tr '\r' '\n' > dsmith.patch $ hg import dsmith.patch
You might also be able to convince TextEdit to convert and save it in "UNIX Linefeed endings" or something.
If Apple Mail has a way to save out the raw mail without breaking it, that works too. Things like patch and 'hg import' can process a whole email and just find the diff inside.
I'm guessing the patch works for me, but I'd like to test it.
Yep, please do :)
I can give some feedback on the README file by reading the raw patch:
- It wouldn't be obvious to me that I can have multiple conversion specs, so an example of: "hexdump_addrfmt = %(addr)03i 0x%(addr)04x prints the address in both decimal and hex"
would be useful.
Surely. Feel free to import this, test it, tweak the README and send it back adjusted accordingly.
Thanks!
--Dan
The free TextWrangler from BareBones is a great Macintosh Text editor, and offers choices of line endings. http://www.barebones.com/products/textwrangler/
Classic Mac: CR Unix: LF Windows CRLF As well as choice of encoding and a host of other great features.
Best, Dave Nathanson KG6ZJO
On Jul 18, 2014, at 10:32 AM, Dan Smith dsmith@danplanet.com wrote:
1 out of 1 hunks FAILED -- saving rejects to file chirpui/mainapp.py.rej abort: patch failed to apply ================
This is saying nothing applied, which generally means that line endings aren't right. I think you're using a mac, which uses \r line endings (sometimes, not always, and I can never remember when/why). My guess would be that you copy-and-paste'd the patch out to a file? In that case, you've got \r endings and the code has \n. Thus, patch (or hg import in this case) can't find any lines that match.
suggest sublime or textmate
________________________________ From: Dave Nathanson KG6ZJO@nathanson.org To: chirp_devel@intrepid.danplanet.com Sent: Friday, July 18, 2014 12:55 PM Subject: Re: [chirp_devel] [PATCH] Allow specification of the hexdump address format
The free TextWrangler from BareBones is a great Macintosh Text editor, and offers choices of line endings. http://www.barebones.com/products/textwrangler/
Classic Mac: CR Unix: LF Windows CRLF As well as choice of encoding and a host of other great features.
Best, Dave Nathanson KG6ZJO
On Jul 18, 2014, at 10:32 AM, Dan Smith dsmith@danplanet.com wrote:
1 out of 1 hunks FAILED -- saving rejects to file chirpui/mainapp.py.rej abort: patch failed to apply ================
This is saying nothing applied, which generally means that line endings aren't right. I think you're using a mac, which uses \r line endings (sometimes, not always, and I can never remember when/why). My guess would be that you copy-and-paste'd the patch out to a file? In that case, you've got \r endings and the code has \n. Thus, patch (or hg import in this case) can't find any lines that match.
_______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
The free TextWrangler from BareBones is a great Macintosh Text editor, and offers choices of line endings. http://www.barebones.com/products/textwrangler/
Classic Mac: CR Unix: LF Windows CRLF As well as choice of encoding and a host of other great features.
Best, Dave Nathanson KG6ZJO
On Jul 18, 2014, at 10:32 AM, Dan Smith dsmith@danplanet.com wrote:
1 out of 1 hunks FAILED -- saving rejects to file chirpui/mainapp.py.rej abort: patch failed to apply ================
This is saying nothing applied, which generally means that line endings aren't right. I think you're using a mac, which uses \r line endings (sometimes, not always, and I can never remember when/why). My guess would be that you copy-and-paste'd the patch out to a file? In that case, you've got \r endings and the code has \n. Thus, patch (or hg import in this case) can't find any lines that match.
participants (5)
-
chirp.cordless@xoxy.net
-
Dan Smith
-
Dave Nathanson
-
Dave Nathanson
-
Jens J.