Sorry this is long, but i'm hoping this is an instructive example.

I'm trying to take the delta between two revisions of a file on a branch
and merge that delta onto the trunk. This doesn't seem to work:

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs status test
===================================================================
File: test              Status: Up-to-date

   Working revision:    1.1
   Repository revision: 1.1     /cvsroot/sandbox/troscoe/test,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -j1.1.2.1 -j1.1.2.2 test
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
Merging differences between 1.1.2.1 and 1.1.2.2 into test
rcsmerge: warning: conflicts during merge

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cat test 
trunk line 1
<<<<<<< test
=======
branch line 1
branch line 2
>>>>>>> 1.1.2.2



Two questions:

1. Why is a conflict being generated, especially considering that the
top half of the conflict is with nothing.

2. Why does "branch line 1" (from 1.1.2.1) come along for the ride when
i do this merge?


Here's a painfully complete picture of the test environment:

### set up a simple test file

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ echo "trunk line 1" > test

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs add test
cvs add: use 'cvs commit' to add this file permanently

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs commit -m "test file initial revision" 
test
RCS file: /cvsroot/sandbox/troscoe/test,v
done
Checking in test;
/cvsroot/sandbox/troscoe/test,v  <--  test
initial revision: 1.1
done


### branch it
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs tag -b BRANCH test
T test

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -rBRANCH test

### check in a couple changes on the branch
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ echo "branch line 1" >> test

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs commit -m"branch line 1" test
Checking in test;
/cvsroot/sandbox/troscoe/test,v  <--  test
new revision: 1.1.2.1; previous revision: 1.1
done

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ echo "branch line 2" >> test
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs commit -m"branch line 2" test
Checking in test;
/cvsroot/sandbox/troscoe/test,v  <--  test
new revision: 1.1.2.2; previous revision: 1.1.2.1
done

### so here's what things look like:
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -r1.1 -p test
trunk line 1

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -r1.1.2.1 -p test
trunk line 1
branch line 1

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -r1.1.2.2 -p test
trunk line 1
branch line 1
branch line 2

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs diff -u -r1.1 -r1.1.2.1 test
Index: test
===================================================================
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -u -r1.1 -r1.1.2.1
--- test        21 Apr 2004 20:56:40 -0000      1.1
+++ test        21 Apr 2004 20:58:35 -0000      1.1.2.1
@@ -1 +1,2 @@
 trunk line 1
+branch line 1

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs diff -u -r1.1.2.1 -r1.1.2.2 test
Index: test
===================================================================
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -u -r1.1.2.1 -r1.1.2.2
--- test        21 Apr 2004 20:58:35 -0000      1.1.2.1
+++ test        21 Apr 2004 20:59:51 -0000      1.1.2.2
@@ -1,2 +1,3 @@
 trunk line 1
 branch line 1
+branch line 2

### i can merge any contiguous parts of the branch back down to the trunk
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs status test
===================================================================
File: test              Status: Up-to-date

   Working revision:    1.1
   Repository revision: 1.1     /cvsroot/sandbox/troscoe/test,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -jBRANCH test
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1
retrieving revision 1.1.2.2
Merging differences between 1.1 and 1.1.2.2 into test

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cat test
trunk line 1
branch line 1
branch line 2

### i can merge backwards to roll back a change
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs status test 
===================================================================
File: test              Status: Up-to-date

   Working revision:    1.1.2.2
   Repository revision: 1.1.2.2 /cvsroot/sandbox/troscoe/test,v
   Sticky Tag:          BRANCH (branch: 1.1.2)
   Sticky Date:         (none)
   Sticky Options:      (none)

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -j1.1.2.2 -j1.1.2.1 test
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.1
Merging differences between 1.1.2.2 and 1.1.2.1 into test

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cat test 
trunk line 1
branch line 1

### and roll back some more
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -j1.1.2.1 -j1.1 test
M test
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1.2.1
retrieving revision 1.1
Merging differences between 1.1.2.1 and 1.1 into test
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cat test
trunk line 1

### but this doesn't work, and i don't understand why
[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs status test
===================================================================
File: test              Status: Up-to-date

   Working revision:    1.1
   Repository revision: 1.1     /cvsroot/sandbox/troscoe/test,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cvs up -j1.1.2.1 -j1.1.2.2 test
RCS file: /cvsroot/sandbox/troscoe/test,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
Merging differences between 1.1.2.1 and 1.1.2.2 into test
rcsmerge: warning: conflicts during merge

[EMAIL PROTECTED]:~/src/sandbox/troscoe]$ cat test 
trunk line 1
<<<<<<< test
=======
branch line 1
branch line 2
>>>>>>> 1.1.2.2



Is there no way to take the delta between two revisions and merge those
onto another branch? Do i have to merge the entire branch down if i want
to do this?

Thanks!
tyler


_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to