Re: rdiff
Derek Robert Price <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.bugs |
|---|---|
| Organization | Ximbiot <http://ximbiot.com> |
| Message-ID | <[email protected]> |
Hrm, I'm not sure why, beacuse your patch looks right, but my patch
program keeps reporting that the patch is already applied:
[oberon@empress ccvs-1.11.x]$ cd src
[oberon@empress src]$ patch -p0 <~/downloads/message.diff
patching file patch.c
Reversed (or previously applied) patch detected! Assume -R? [n]
[oberon@empress src]$
Regardless, I looked into it myself and I think the correct patch is
more like the following:
Index: src/patch.c
===================================================================
RCS file: /cvsroot/ccvs/src/patch.c,v
retrieving revision 1.80.4.1
diff -u -r1.80.4.1 patch.c
--- src/patch.c 7 Mar 2003 19:53:49 -0000 1.80.4.1
+++ src/patch.c 4 Jun 2003 14:24:38 -0000
@@ -464,8 +464,11 @@
goto out2;
}
- if (patch_short)
+ if( patch_short && ( vers_tag == NULL || vers_head == NULL ) )
{
+ /* For adds & removes with a short patch requested, we can print our
+ * error message now and get out.
+ */
cvs_output ("File ", 0);
cvs_output (finfo->fullname, 0);
if (vers_tag == NULL)
@@ -474,7 +477,7 @@
cvs_output (vers_head, 0);
cvs_output ("\n", 1);
}
- else if (vers_head == NULL)
+ else
{
cvs_output (" is removed; not included in ", 0);
if (rev2 != NULL)
@@ -491,14 +494,6 @@
cvs_output ("current release", 0);
cvs_output ("\n", 1);
}
- else
- {
- cvs_output (" changed from revision ", 0);
- cvs_output (vers_tag, 0);
- cvs_output (" to ", 0);
- cvs_output (vers_head, 0);
- cvs_output ("\n", 1);
- }
ret = 0;
goto out2;
}
@@ -596,6 +591,18 @@
* lines of the diff output file, and munge them to include more
* reasonable file names that "patch" will understand.
*/
+ if( patch_short )
+ {
+ cvs_output( "File ", 0 );
+ cvs_output( finfo->fullname, 0 );
+ cvs_output( " changed from revision ", 0 );
+ cvs_output( vers_tag, 0 );
+ cvs_output( " to ", 0 );
+ cvs_output( vers_head, 0 );
+ cvs_output( "\n", 1 );
+ ret = 0;
+ goto out2;
+ }
/* Output an "Index:" line for patch to use */
cvs_output ("Index: ", 0);
The sanity.sh tests pass with this patch, but your cases do not appear
to be tested. Could you write some sanity.sh test cases for an added
file, a removed file, a file with no differences between releases, and a
file which exists but was not in either release, so that I may commit
this? It would probably be simplest to just add a new test set,
rdiff-add-remove-nodiff or the like.
Thanks,
Derek
Paul Edwards wrote:
>"Derek Robert Price" <[email protected]> wrote in message news:[email protected]...
>
>
>>Paul Edwards wrote:
>>
>>
>>
>>>I noticed the changes on the cvs1-11-x-branch - thanks.
>>>
>>>
>>You're welcome. Thanks for your help.
>>
>>
>>
>>>Can you put the phantom "rdiff -s" change on there too?
>>>
>>>
>>Huh? Which change was that?
>>
>>
>
>The one below...
>
>BFN. Paul.
>
>
>"Derek Robert Price" <[email protected]> wrote in message news:[email protected]...
>
>
>>Paul Edwards wrote:
>>
>>
>>
>>>I have confirmed that these patches both work like a dream.
>>>
>>>
>>On the current stable tree, your changes to patch.c were made some time ago.
>>
>>
>
>I can't find them in any of the cvs diffs I did.
>
>I compared cvs1-11-5 to cvs1-11-6 and cvs1-11-6 to cvs1-11-x-branch
>and cvs1-11-6 to 1.82 (cvs1-12-1). I can't find anything in the
>"cvs log" that is later than 2003/03/31 on any branch.
>
>Is there a trick to it?
>
>Thanks. Paul.
>
>
>_______________________________________________
>Bug-cvs mailing list
>[email protected]
>http://mail.gnu.org/mailman/listinfo/bug-cvs
>
>
--
*8^)
Email: [email protected]
Get CVS support at <http://ximbiot.com>!
--
I will not charge admission to the bathroom.
I will not charge admission to the bathroom.
I will not charge admission to the bathroom...
- Bart Simpson on chalkboard, _The Simpsons_