Source-Changes-HG archive

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

[src/trunk]: src/external/gpl2/xcvs/dist/src implement cvs rdiff -p. (someon...



details:   https://anonhg.NetBSD.org/src/rev/214817635d1d
branches:  trunk
changeset: 769814:214817635d1d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Sep 24 11:37:27 2011 +0000

description:
implement cvs rdiff -p.  (someone please upate the manual for me :)

diffstat:

 external/gpl2/xcvs/dist/src/patch.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r f1b5f0e95945 -r 214817635d1d external/gpl2/xcvs/dist/src/patch.c
--- a/external/gpl2/xcvs/dist/src/patch.c       Sat Sep 24 11:17:25 2011 +0000
+++ b/external/gpl2/xcvs/dist/src/patch.c       Sat Sep 24 11:37:27 2011 +0000
@@ -43,16 +43,18 @@
 static char *tmpfile2 = NULL;
 static char *tmpfile3 = NULL;
 static int unidiff = 0;
+static int show_c_func = 0;
 
 static const char *const patch_usage[] =
 {
-    "Usage: %s %s [-flR] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n",
+    "Usage: %s %s [-flR] [-p] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n",
     "    -r rev|-D date [-r rev2 | -D date2] modules...\n",
     "\t-f\tForce a head revision match if tag/date not found.\n",
     "\t-l\tLocal directory only, not recursive\n",
     "\t-R\tProcess directories recursively.\n",
     "\t-c\tContext diffs (default)\n",
     "\t-u\tUnidiff format.\n",
+    "\t-p\tShow which C function each change is in.\n",        /* --show-c-function */
     "\t-s\tShort patch - one liner per file.\n",
     "\t-t\tTop two diffs - last change made to the file.\n",
     "\t-V vers\tUse RCS Version \"vers\" for keyword expansion.\n",
@@ -78,7 +80,7 @@
        usage (patch_usage);
 
     getoptreset ();
-    while ((c = getopt (argc, argv, "+V:k:cuftsQqlRD:r:")) != -1)
+    while ((c = getopt (argc, argv, "+V:k:cuftsQqlRD:r:p")) != -1)
     {
        switch (c)
        {
@@ -154,6 +156,9 @@
            case 'c':                   /* Context diff */
                unidiff = 0;
                break;
+           case 'p':
+               show_c_func = 1;
+               break;
            case '?':
            default:
                usage (patch_usage);
@@ -202,6 +207,8 @@
            send_arg("-s");
        if (unidiff)
            send_arg("-u");
+       if (show_c_func)
+           send_arg("-p");
 
        if (rev1)
            option_with_arg ("-r", rev1);
@@ -571,6 +578,8 @@
 
     if (unidiff) run_add_arg_p (&dargc, &darg_allocated, &dargv, "-u");
     else run_add_arg_p (&dargc, &darg_allocated, &dargv, "-c");
+    if (show_c_func)
+        run_add_arg_p (&dargc, &darg_allocated, &dargv, "-p");
     switch (diff_exec (tmpfile1, tmpfile2, NULL, NULL, dargc, dargv,
                       tmpfile3))
     {



Home | Main Index | Thread Index | Old Index