|
Home > Archive > Unix Programming > June 2007 > CVS question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Bin Chen 2007-06-18, 7:23 am |
| If I make a branch in 1.2, and then the file grow to 1.10 by others
but my version is 1.2.1.3, I wan to commit the 1.2.1.3 to main
branch(revision 1), that means I want to overwrite 1.10, but when I
do:
cvs ci -r 1 a.c (which local revision is 1.2.1.3)
then the cvs complains up-to-date check fail, which I think is caused
by the revision 1.10 against 1.2. So is there a command to force
1.2.1.3 can overwrite 1.10 to become 1.11?
Thanks.
Bin
| |
| Bin Chen 2007-06-18, 7:23 am |
| On Jun 18, 2:23 pm, Bin Chen <binary.c...@gmail.com> wrote:
> If I make a branch in 1.2, and then the file grow to 1.10 by others
> but my version is 1.2.1.3, I wan to commit the 1.2.1.3 to main
> branch(revision 1), that means I want to overwrite 1.10, but when I
> do:
>
> cvs ci -r 1 a.c (which local revision is 1.2.1.3)
>
> then the cvs complains up-to-date check fail, which I think is caused
> by the revision 1.10 against 1.2. So is there a command to force
> 1.2.1.3 can overwrite 1.10 to become 1.11?
>
Together with another question, if I check out a tag tag_a, and modify
this file, then I want commit the file to the branch which the tag_a
reside in, which command can I use?
| |
| Icarus Sparry 2007-06-18, 1:25 pm |
| On Sun, 17 Jun 2007 23:23:49 -0700, Bin Chen wrote:
> If I make a branch in 1.2, and then the file grow to 1.10 by others but
> my version is 1.2.1.3, I wan to commit the 1.2.1.3 to main
> branch(revision 1), that means I want to overwrite 1.10, but when I do:
>
> cvs ci -r 1 a.c (which local revision is 1.2.1.3)
>
> then the cvs complains up-to-date check fail, which I think is caused by
> the revision 1.10 against 1.2. So is there a command to force 1.2.1.3
> can overwrite 1.10 to become 1.11?
>
> Thanks.
> Bin
This is usually the wrong thing to do, CVS has no way of knowing that
your code is so much better than the other 8 changes made by other
people, which is why it does not allow you to do this.
The normal way to get around this is
1) check in your code to 1.2.1.3
2) check out version 1.10 for edit
3) "print" version 1.2.1.3 to standard output, and redirect standard
output to the a.c file. (use 'cvs co -p -r 1.2.1.3 > a.c')
4) check in the altered 1.10 file to become 1.11.
| |
| Bin Chen 2007-06-18, 1:25 pm |
| On Jun 18, 11:05 pm, Icarus Sparry <use...@icarus.freeuk.com> wrote:
> On Sun, 17 Jun 2007 23:23:49 -0700, Bin Chen wrote:
>
>
>
>
> This is usually the wrong thing to do, CVS has no way of knowing that
> your code is so much better than the other 8 changes made by other
> people, which is why it does not allow you to do this.
>
> The normal way to get around this is
>
> 1) check in your code to 1.2.1.3
> 2) check out version 1.10 for edit
> 3) "print" version 1.2.1.3 to standard output, and redirect standard
> output to the a.c file. (use 'cvs co -p -r 1.2.1.3 > a.c')
> 4) check in the altered 1.10 file to become 1.11.
Thanks. I do know this is not a right way, but what about I can know
the change is safe in the first place? So there still has some chance
to do such thing 
And how about the other question, how to edit a tagged file and submit
it to its original branch in one command?
| |
| Giorgos Keramidas 2007-06-19, 7:22 am |
| On Mon, 18 Jun 2007 15:46:25 -0000, Bin Chen <binary.chen@gmail.com> wrote:
> And how about the other question, how to edit a tagged file and submit
> it to its original branch in one command?
What do you mean by `edit a tagged file'?
| |
| Bin Chen 2007-06-19, 7:22 am |
| On Jun 19, 3:28 pm, Giorgos Keramidas <keram...@ceid.upatras.gr>
wrote:
> On Mon, 18 Jun 2007 15:46:25 -0000, Bin Chen <binary.c...@gmail.com> wrote:
>
> What do you mean by `edit a tagged file'?
cvs up -r tag_1 a.c
vi a.c
:wq
cvs ci
| |
| Giorgos Keramidas 2007-06-19, 1:28 pm |
| On Tue, 19 Jun 2007 10:52:39 -0000, Bin Chen <binary.chen@gmail.com> wrote:
>On Jun 19, 3:28 pm, Giorgos Keramidas <keram...@ceid.upatras.gr>
>wrote:
>
> cvs up -r tag_1 a.c
> vi a.c
> :wq
> cvs ci
You can't 'commit on top of a tag'.
You can only commit to the "head of a branch".
A workaround for the fact that tags in CVS are 'special names for a
particular version of a file', is to spawn a branch off the particular
date that a tag denotes:
cvs tag -b -r tag_1 branch_1
cvs up -PAd -r branch_1
vi a.c
:wq
cvs ci a.c
This will commit the changes 'in branch_1'.
|
|
|
|
|