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: Tue, 10 Jun 2003 13:28:58 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Paul Edwards wrote:

"Derek Robert Price" <address@hidden> wrote in message news:address@hidden
1.2 is the "tag2 revision", maybe, but
"previous" just dangles, especially when the possibilities include a tag
attached to the same revision as tag2, attached to another revision,
attached to a dead revision, and not attached to any revision.

What would people think if I left out the reiteration of tag4 and used
something to the effect of:

   `File abc/file1.txt is removed; tag2 revision 1.2'

I was going to suggest you include the old ...
'... not included in release tag tag4'
as well, but looking at the other messages, none of the others
mention tags in the message.

Perhaps just "obsolete revision 1.2"?  Mirroring added ones?

Actually, I altered the add case to print the tag or date too. I thought it would be clearer and more polite than expecting the user to have read the manual and immediately be able to interpret the direction of the diff and figure out what revision, exactly, the "previous", "obsolete", or anything else I thought of was. Not that most users shouldn't know already - this one is pretty easy, but a little extra clarity shouldn't hurt.

I have the change tested and I'm just waiting for coments before I commit. Here's the patch:

Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/ccvs/src/ChangeLog,v
retrieving revision 1.2336.2.59
diff -u -r1.2336.2.59 ChangeLog
--- src/ChangeLog       9 Jun 2003 20:19:22 -0000       1.2336.2.59
+++ src/ChangeLog       10 Jun 2003 17:24:08 -0000
@@ -1,3 +1,13 @@
+2003-06-10  Derek Price  <address@hidden>
+
+       * patch.c (patch_fileproc): Output revision number or the first
+       revision in the removed case.
+       (Idea from Paul Edwards <address@hidden>.)
+
+       * sanity.sh (rdiff-add-remove-nodiff): Rename to...
+       (rdiff-short): ...this.  Test for the above changes.  Add some tests
+       for when rev2 defaults to the trunk.  Expand comments.
+
2003-06-09  Derek Price  <address@hidden>

        * rcs.c (RCS_delete_revs): Reference WOE32 rather than WIN32 in
Index: src/patch.c
===================================================================
RCS file: /cvsroot/ccvs/src/patch.c,v
retrieving revision 1.80.4.2
diff -u -r1.80.4.2 patch.c
--- src/patch.c 9 Jun 2003 17:46:09 -0000       1.80.4.2
+++ src/patch.c 10 Jun 2003 17:24:08 -0000
@@ -469,25 +469,18 @@
        cvs_output (finfo->fullname, 0);
        if (vers_tag == NULL)
        {
-           cvs_output (" is new; current revision ", 0);
+           cvs_output( " is new; ", 0 );
+           cvs_output( rev2 ? rev2 : date2 ? date2 : "current", 0 );
+           cvs_output( " revision ", 0 );
            cvs_output (vers_head, 0);
            cvs_output ("\n", 1);
        }
        else
        {
-           cvs_output (" is removed; not included in ", 0);
-           if (rev2 != NULL)
-           {
-               cvs_output ("release tag ", 0);
-               cvs_output (rev2, 0);
-           }
-           else if (date2 != NULL)
-           {
-               cvs_output ("release date ", 0);
-               cvs_output (date2, 0);
-           }
-           else
-               cvs_output ("current release", 0);
+           cvs_output( " is removed; ", 0 );
+           cvs_output( rev1 ? rev1 : date1, 0 );
+           cvs_output( " revision ", 0 );
+           cvs_output( vers_tag, 0 );
            cvs_output ("\n", 1);
        }
        ret = 0;
Index: src/sanity.sh
===================================================================
RCS file: /cvsroot/ccvs/src/sanity.sh,v
retrieving revision 1.752.2.25
diff -u -r1.752.2.25 sanity.sh
--- src/sanity.sh       9 Jun 2003 17:46:09 -0000       1.752.2.25
+++ src/sanity.sh       10 Jun 2003 17:24:12 -0000
@@ -721,7 +721,7 @@
        tests="${tests} commit-add-missing"
        tests="${tests} status"
        # Branching, tagging, removing, adding, multiple directories
-       tests="${tests} rdiff rdiff-add-remove-nodiff"
+       tests="${tests} rdiff rdiff-short"
        tests="${tests} rdiff2 diff death death2 rm-update-message rmadd"
        tests="${tests} rmadd2 dirs dirs2 branches branches2 tagc tagf"
        tests="${tests} rcslib multibranch import importb importc"
@@ -3990,22 +3990,28 @@
                rm -rf ${CVSROOT_DIRNAME}/trdiff
                ;;

-       rdiff-add-remove-nodiff)
+       rdiff-short)
          # Test that the short patch behaves as expected
-         mkdir rdiff-add-remove-nodiff; cd rdiff-add-remove-nodiff
+         #   1) Added file.
+         #   2) Removed file.
+         #   3) Different revision number with no difference.
+         #   4) Different revision number with changes.
+         #   5) Against trunk.
+         #   6) Same revision number (no difference).
+         mkdir rdiff-short; cd rdiff-short
          mkdir abc
-         dotest rdiff-add-remove-nodiff-init-1 \
+         dotest rdiff-short-init-1 \
"${testcvs} -q import -I ! -m initial-import abc vendor initial" \
'
No conflicts created by this import'

-         dotest rdiff-add-remove-nodiff-init-2 "${testcvs} -q get abc" ''
+         dotest rdiff-short-init-2 "${testcvs} -q get abc" ''
          cd abc
          echo "abc" >file1.txt
-         dotest rdiff-add-remove-nodiff-init-3 "${testcvs} add file1.txt" \
+         dotest rdiff-short-init-3 "${testcvs} add file1.txt" \
"${PROG} [a-z]*: scheduling file .file1\.txt' for addition
${PROG} [a-z]*: use '${PROG} commit' to add this file permanently"
-         dotest rdiff-add-remove-nodiff-init-4 \
+         dotest rdiff-short-init-4 \
"${testcvs} commit -madd-file1 file1.txt" \
"RCS file: ${CVSROOT_DIRNAME}/abc/file1\.txt,v
done
@@ -4014,34 +4020,34 @@
initial revision: 1\.1
done"
          echo def >>file1.txt
-         dotest rdiff-add-remove-nodiff-init-5 \
+         dotest rdiff-short-init-5 \
"${testcvs} commit -mchange-file1 file1.txt" \
"Checking in file1\.txt;
${CVSROOT_DIRNAME}/abc/file1\.txt,v  <--  file1\.txt
new revision: 1\.2; previous revision: 1\.1
done"
          echo "abc" >file1.txt
-         dotest rdiff-add-remove-nodiff-init-6 \
+         dotest rdiff-short-init-6 \
"${testcvs} commit -mrestore-file1-rev1 file1.txt" \
"Checking in file1\.txt;
${CVSROOT_DIRNAME}/abc/file1\.txt,v  <--  file1\.txt
new revision: 1\.3; previous revision: 1\.2
done"
-         dotest rdiff-add-remove-nodiff-init-7 \
+         dotest rdiff-short-init-7 \
"${testcvs} tag -r 1.1 tag1 file1.txt" \
"T file1\.txt"
-         dotest rdiff-add-remove-nodiff-init-8 \
+         dotest rdiff-short-init-8 \
"${testcvs} tag -r 1.2 tag2 file1.txt" \
"T file1\.txt"
-         dotest rdiff-add-remove-nodiff-init-9 \
+         dotest rdiff-short-init-9 \
"${testcvs} tag -r 1.3 tag3 file1.txt" \
"T file1\.txt"
          echo "abc" >file2.txt
-         dotest rdiff-add-remove-nodiff-init-10 \
+         dotest rdiff-short-init-10 \
"${testcvs} add file2.txt" \
"${PROG} [a-z]*: scheduling file .file2\.txt' for addition
${PROG} [a-z]*: use '${PROG} commit' to add this file permanently"
-         dotest rdiff-add-remove-nodiff-init-11 \
+         dotest rdiff-short-init-11 \
"${testcvs} commit -madd-file2 file2.txt" \
"RCS file: ${CVSROOT_DIRNAME}/abc/file2\.txt,v
done
@@ -4049,29 +4055,46 @@
${CVSROOT_DIRNAME}/abc/file2\.txt,v  <--  file2\.txt
initial revision: 1\.1
done"
-         dotest rdiff-add-remove-nodiff-init-12 \
+         dotest rdiff-short-init-12 \
"${testcvs} tag -r 1.1 tag4 file2.txt" \
"T file2\.txt"
-         dotest rdiff-add-remove-nodiff-init-13 \
+         dotest rdiff-short-init-13 \
"${testcvs} tag -r 1.1 tag5 file2.txt" \
"T file2\.txt"
          cd ../..
-         rm -fr rdiff-add-remove-nodiff
+         rm -fr rdiff-short

-         dotest rdiff-add-remove-nodiff-no-real-change \
+         # 3) Different revision number with no difference.
+         dotest rdiff-short-no-real-change \
"${testcvs} -q rdiff -s -r tag1 -r tag3 abc"

-         dotest rdiff-add-remove-nodiff-real-change \
+         # 4) Different revision number with changes.
+         dotest rdiff-short-real-change \
"${testcvs} -q rdiff -s -r tag1 -r tag2 abc" \
'File abc/file1.txt changed from revision 1\.1 to 1\.2'

-         dotest_sort rdiff-add-remove-nodiff-remove-add \
+         # 1) Added file.
+         # 2) Removed file.
+         dotest_sort rdiff-short-remove-add \
"${testcvs} -q rdiff -s -r tag2 -r tag4 abc" \
-'File abc/file1\.txt is removed; not included in release tag tag4
-File abc/file2\.txt is new; current revision 1\.1'
+'File abc/file1\.txt is removed; tag2 revision 1\.2
+File abc/file2\.txt is new; tag4 revision 1\.1'

-         dotest rdiff-add-remove-nodiff-no-change \
- "${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
+         # 6) Same revision number (no difference).
+         dotest rdiff-short-no-change \
+"${testcvs} -q rdiff -s -r tag4 -r tag5 abc"
+
+         # 5) Against trunk.
+         # Check that the messages change when we diff against the trunk
+         # rather than a tag or date.
+         dotest rdiff-short-against-trunk-1 \
+"${testcvs} -q rdiff -s -rtag4 abc" \
+"File abc/file1\.txt is new; current revision 1\.3"
+
+         dotest rdiff-short-against-trunk-2 \
+"${testcvs} -q rdiff -s -rtag2 abc" \
+"File abc/file1\.txt changed from revision 1\.2 to 1\.3
+File abc/file2\.txt is new; current revision 1\.1"

          rm -rf ${CVSROOT_DIRNAME}/abc
          ;;



Derek

--
               *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
--
I will not buy a presidential pardon.
I will not buy a presidential pardon.
I will not buy a presidential pardon...

        - Bart Simpson on chalkboard, _The Simpsons_







reply via email to

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