You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jean T. Anderson" <jt...@bristowhill.com> on 2006/08/25 01:30:34 UTC

Need help applying patch for DERBY-1685

I'm having trouble applying patch derby1685_ref3.diff . The short story
is Laura changed the name of a file and I'm trying to figure out how to
make this work.

So, up front I get this error:

   $ patch -p0 -i derby1685_ref3.diff
   patching file src/ref/rrefonlinebackupdbnowaitproc.dita
   can't find file to patch at input line 54
   Perhaps you used the wrong -p or --strip option?
   The text leading up to this was:
   --------------------------
   |Index: src/ref/rrefbackupdbnowaitproc.dita
   |===================================================================
   |--- src/ref/rrefbackupdbnowaitproc.dita        (revision 433765)
   |+++ src/ref/rrefbackupdbnowaitproc.dita        (working copy)
   --------------------------
   File to patch:

The file referenced at line 54 doesn't exist. I chatted with Laura on
IRC and she did an 'svn move' to change the name of one of the files.

For the "File to patch" I tried putting in the file before the name changed:

   src/ref/rrefonlinebackupdbnowaitproc.dita

But that didn't work:

   patching file src/ref/rrefonlinebackupdbnowaitproc.dita
   Hunk #1 FAILED at 1.
   Hunk #2 FAILED at 18.
   2 out of 2 hunks FAILED -- saving rejects to file
src/ref/rrefonlinebackupdbnowaitproc.dita.rej

Next I did the 'svn move' before applying the patch:

  svn move rrefonlinebackupdbnowaitproc.dita rrefbackupdbnowaitproc.dita

But now I get this error:

   [jta@gertie3 trunk]$ patch -p0 -i derby1685_ref3.diff
   The next patch would delete the file
src/ref/rrefonlinebackupdbnowaitproc.dita,
   which does not exist!  Assume -R? [n]

On IRC she thought she first edited the file, then did the 'svn move'.

Does anyone have any suggestions on how to apply this patch?
Or suggestions for Laura on how to create a patch that renames a file?

My inclination is to ask Laura to undo the file rename and create a new
patch, then include instructions in the Jira issue to 'svn move' the
file before attempting to do the doc build (since the ditamap will
reference the new filename). Does that seem like the best way?

I'm open to suggestions.

thanks,

 -jean




Re: Need help applying patch for DERBY-1685

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Andrew McIntyre wrote:
> On 8/24/06, Jean T. Anderson <jt...@bristowhill.com> wrote:
>>
>> On IRC she thought she first edited the file, then did the 'svn move'.
>>
>> Does anyone have any suggestions on how to apply this patch?
>> Or suggestions for Laura on how to create a patch that renames a file?
> 
> This seems to be a peculiarity of how svn creates patch files for
> moves. Patch, at least on my machine never actually removes empty
> files, and you need the old file to be there to remove its contents
> for the patch to apply cleanly. So try:
> 
> svn move rrefonlinebackupdbnowaitproc.dita rrefbackupdbnowaitproc.dita
> cp rrefbackupdbnowaitproc.dita rrefonlinebackupdbnowaitproc.dita
> patch -p0 -i derby1685_ref3.diff
> # verify that rrefonlinebackupdbnowaitproc.dita is in fact empty, and:
> rm rrefonlinebackupdbnowaitproc.dita

whew! that seems to have worked. I'll kick off a build to verify, then
commit.

thanks!

 -jean



Re: Need help applying patch for DERBY-1685

Posted by Andrew McIntyre <mc...@gmail.com>.
On 8/24/06, Jean T. Anderson <jt...@bristowhill.com> wrote:
>
> On IRC she thought she first edited the file, then did the 'svn move'.
>
> Does anyone have any suggestions on how to apply this patch?
> Or suggestions for Laura on how to create a patch that renames a file?

This seems to be a peculiarity of how svn creates patch files for
moves. Patch, at least on my machine never actually removes empty
files, and you need the old file to be there to remove its contents
for the patch to apply cleanly. So try:

svn move rrefonlinebackupdbnowaitproc.dita rrefbackupdbnowaitproc.dita
cp rrefbackupdbnowaitproc.dita rrefonlinebackupdbnowaitproc.dita
patch -p0 -i derby1685_ref3.diff
# verify that rrefonlinebackupdbnowaitproc.dita is in fact empty, and:
rm rrefonlinebackupdbnowaitproc.dita

andrew