bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rdiff


From: Derek Robert Price
Subject: Re: rdiff
Date: Wed, 04 Jun 2003 11:21:33 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

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" <derek@ximbiot.com> wrote in message 
news:mailman.7208.1054648424.21513.bug-cvs@gnu.org...
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" <derek@ximbiot.com> wrote in message 
news:mailman.7024.1054235988.21513.bug-cvs@gnu.org...
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
Bug-cvs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-cvs

--
               *8^)

Email: derek@ximbiot.com

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_







reply via email to

[Prev in Thread] Current Thread [Next in Thread]