We've come up with a patch for rcscmds.c (attached) that makes merges 
to/from longterm branches work very nicely for us.  We're not sure of 
all the ramifications for every possible use case of cvs, but it 
seems reasonable that this should be the desired behavior for merges.

When doing a three-way merge versus a file in your working directory, 
cvs checks out the two versions to compare against and creates 
temporary copies in the working directory.  Our patch addresses this 
checkout.  If the kflags on the file are -kb, then cvs behaves as it 
normally would.  Also, if explicit kflags are specified on the 
command-line, then those are respected.  However, if no kflags are 
specified on the command-line, and the file is not marked as -kb, 
then the checkout (of the two revisions against which the diff is to 
be done) uses -kk.  This results in comparisons against unexpanded 
keywords, which eliminates spurious conflicts based on keyword 
expansion alone.

I'd like to suggest incorporation of this patch into cvs, but I'm 
curious whether anybody has reasons that it should not be 
incorporated.

(Note: I don't take credit for this patch myself; it was actually 
created by Jay Sachs, chief architect in charge of core technology 
here at iClick.)
--- rcscmds.c   Mon Dec 13 15:57:07 1999
+++ /tmp/rcscmds.c      Mon Apr 17 10:11:37 2000
@@ -251,6 +251,11 @@
      if (options != NULL && options[0] != '\0')
        assert (options[0] == '-' && options[1] == 'k');

+    if (options == NULL || options[0] == '\0') {
+      cvs_output("Disabling keyword expansion for join\n",0);
+      options = "-kk";
+    }
+
      cvs_output ("RCS file: ", 0);
      cvs_output (rcs->path, 0);
      cvs_output ("\n", 1);
-- 
+-------------------------------------------------------------------+
| Dave Makower                                 <[EMAIL PROTECTED]> |
| Manager of Portal Architecture & Development                      |
+--------------------------------+----------------------------------+
|   iClick, Inc.                 |   (914) 872-8030                 |
|   120 Bloomingdale Road        |   (914) 872-8100   fax           |
|   3rd Floor                    |   (914) 872-8000   main          |
|   White Plains, NY  10605      |   http://www.iclick.com/         |
+--------------------------------+----------------------------------+

Reply via email to