Forums

Escaping substitution in strings

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: Escaping substitution in strings

Postby hopscc » Tue Jun 03, 2008 2:01 am

Yeah - I get the same with the downloaded patch (and my orig copy so its something I've screwed up ..)
Its a std svn patch. svn ver 1.4.6.
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Escaping substitution in strings

Postby hopscc » Tue Jun 03, 2008 6:31 am

Dunno, Looks like The line count of the chunk in that patch are wrong.
The only thing I can think of is that I edited the patch file to remove some changes in that file ( CobraTokenizer) not associated with that particular patch and
removed some whitespace lines in chunks I shouldn't have (??).
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Escaping substitution in strings

Postby hopscc » Sat Jul 05, 2008 4:03 am

FWIW I Think I've found the real source of this:
Under some circumstances some parts of a diff file made from svn diff (on my system at least) end up with incorrect line endings
for a windows platform.
A subsequent patch run on that file does any number of unexpected things from
- throwing an assert error in patch.c line 339
- complaining about a missing file name from a line number in the middle of a patch line
- complaining about malformed lines..
None of which include describing the problem correctly.

If you read and write the patch file in an editor ( presumably thusly sanitising the eoln tokens) an erstwhile
broken patchfile starts working fine...
I'll try and remember to do this in future but if I miss thats the workaround.

a suggested fix of running patch with the --binary switch doesnt work - causes every hunk of the patchfile to fail.
svn, version 1.4.6 (r28521)
patch 2.5.9
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Escaping substitution in strings

Postby Charles » Sat Jul 05, 2008 6:27 pm

Weird. I have all the files set to native line ending and they all are the same in the repository (unix style on the server side). Or at least, they should be. Actually, I'm pretty sure they are because I have a program that checks for it.

I also have Cobra workspaces on the Mac side, so in the future I'll also try that as a workaround. In fact, I'll try it now.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Escaping substitution in strings

Postby Charles » Sat Jul 05, 2008 6:35 pm

Didn't work on the Mac side. On Windows, I used UltraEdit to convert the patch file to DOS line endings. Same error. Then I converted to UNIX line endings. Same error.
Code: Select all
>patch -p0 -i rmdupcode.patch
patching file CobraTokenizer.cobra
patch: **** malformed patch at line 14: @@ -743,6 +773,25 @@

So this is still a mystery to me.

I'm on patch 2.5.8. My Subversion version (1.3.x) doesn't matter because it doesn't come into play at this point.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Escaping substitution in strings

Postby hopscc » Sun Jul 06, 2008 2:12 am

WHoops my bad - I have an updated patchfile I should have uploaded but didnt.

Download and patch of the one I posted gives the same error you see.
I regenerated the patch and its different from the original.
The regen one works (after the line end thing).

sorry sorry sorry
Attachments
rmdupcode1.patch
regen patch
(3.14 KiB) Downloaded 595 times
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Escaping substitution in strings

Postby Charles » Sun Jul 06, 2008 9:54 am

No problem, but let's take it from the top. What commands did you use to generate the patch that didn't work vs. the one that did? Are you on Windows, Mac or Linux?

(Don't resubmit. I applied the last patch and am running regression tests now.)

Also, rather than putting a comment above a def like so:
# helper for matching between a range of chars
def _matchBetween(input as String, start as char, stopch as char, breakch as char) as String?

Put a doc string below:
def _matchBetween(input as String, start as char, stopch as char, breakch as char) as String?
"""
Matches between a range of character.
"""

And I dropped "helper" because that's common to protected methods.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Escaping substitution in strings

Postby hopscc » Sun Jul 06, 2008 7:25 pm

XP Pro SP3 (now)
Same command for both succeed or fail
svn diff >name.patch ( or svn di >name.patch)
in either Source or root workspace directory (irrelevant which)

( thats why I say under some circumstances - I dont know what the circumstances are yet)
the earlier patches worked fine
This one was the first where it didnt (that know about so far) but some since there have also failed when test them before upload.

Dont recall any system change/addition around that time ( which isnt to say that there werent any)
I did upgrade to SP3 tho think did that later than gen this patch...

Dont worry about it - Not your problem or anything to do with Cobra install or config - I'll just chk each patch works on clean tree
before upload.

One other strangeness I get is when I upload a patch both in discussion and in Trac/Tickets ( upload an attachment)
more often than not my browser hard hangs (both Firefox 2 and 3 also did so the once I tried upload with IE)
- looks like it happens after the upload ( text and attachment ) completes
since the uploaded change is there when I restart -
Mostly it hangs waiting for something ( busy cursor) but it disables all other interaction in the browser - have to kill it using the 'Not Responding' popup
dialog - any ideas off the top of your head about that?
(if not dont invest any time in it - theres some weird characteristics with the internet infrastructure here due telco ignorance, equipment malconfig and/or traffic shaping policies
that cause both static and intermittant widespread irregularities - Its probably either something obscure whacked on my windows box or that)

I'll try and remember the method docstring instead of the precomment ( you might add a reminder/note in the how-to-create-a-patch web page)
feel free to change the naming anyway that makes sense and you have the motivation/bandwidth for (or get me to redo it).
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Escaping substitution in strings

Postby Charles » Sun Jul 06, 2008 8:49 pm

Thanks for the reply. Sorry to say I don't have any ideas off the top of my head about the problems you're having.

-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Previous

Return to Discussion

Who is online

Users browsing this forum: No registered users and 108 guests

cron