bug-cvs
[Top][All Lists]
Advanced

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

Re: cvs add & join inconsistency


From: Paul Edwards
Subject: Re: cvs add & join inconsistency
Date: Sat, 22 Feb 2003 03:11:56 GMT

"Pierre Asselin" <pa@panix.com> wrote in message 
news:b36hos$bvq$1@reader1.panix.com...
> Paul Edwards <kerravon@nosppaam.w3.to> wrote:
> > With CVS 1.11.5 if I do the following:
>
> > 1. add a file with cvs add, on my own branch, it goes into Attic
>
> > 2. Import that same file (import-tag2)
>
> > 3. Do a cvs update -j import-tag1 -j import-tag2
>
> > Normal operation (if I hadn't already been added in the branch),
> > would be for the file to get added on my branch.
>
> Shouldn't you be doing the update -j -j on your trunk?  The trunk

Locally (we are the surrogate site), we have 3 separate
projects on 3 separate branches.  One project adds the
file.  It is only that project that gets incorrect behaviour.

The other projects all get the newly imported file added
to their branch.

We rarely use the trunk, and only for a specific minor purpose.

> is always broken after an import until you fix it with an update.
> Mind you, cvs may do asinine things when you attempt to commit
> your import merge to the trunk, or later when you try to merge
> your branch back.  I'm not sure what happens with the file added
> in two places like that, but I'd like to know what breaks when
> using a more standard procedure.

It breaks too (see below).

> > In this case the file has already been added, so what I want is
> > the imported file to replace my "advance beta version" of the
> > file.
>
> Hmmm, so you always work on branch

Yes, multiple projects.

> and keep your trunk identical to the official releases?

Trunk unused.

> I still think you want the replacement
> to occur on the trunk, not the branch.

It should work either way.

> > Or at the very least give me a conflict.
>
> > Instead, the attempt to add the imported file is ignored, and the
> > branch stays behind.
>
> Do a cvs log on your file.  Is the RCS file still in the Attic?

Yes, that's another problem.  I don't like the file being in the
Attic.  If not during the import, then when is the file ever going
to be moved into the mainstream?  It doesn't appear to cause
any problems in the Attic though.

> Does it have the new imported version with its import tag?  Does

Yes.

> it have its RCS default branch set to the vendor branch or to
> the trunk?

I don't know the answer to that, I'm not familiar with the RCS
default branch.  Where do I see that?

Anyway, I've written a script to show the problem.  I ran this at
home (Windows) rather than at work (Unix) so perhaps the
behaviour is different.  And also there are error messages that
come up which I hadn't noticed at work (since the volume is
so large).

But what I am concerned about is that when I do the final
"cvs commit" it doesn't say "unresolved conflicts" or "up to
date check failed" or something like that.  It instead commits
it without failsafing.  I was quite surprised to find that my
branch was different from the import, after having done the
update.

Anyway, here's the script that shows the problem on the trunk,
rather than the branch...

rm -fr //o/cvs/testtest
mkdir //o/cvs/testtest

rm -fr testtest
cvs get testtest
cd testtest
echo hello >file.c
cvs add file.c
cvs commit -m "." file.c
rm -fr CVS
mv file.c unrelated.c
cvs import -m "import" testtest branch_official release-1
cp unrelated.c file.c
echo there >>file.c
cvs import -m "import" testtest branch_official release-2
cd ..
rm -fr testtest
cvs get testtest
cvs update -j release-1 -j release-2
cvs commit -m "merged in release 2"

And the output is...

cvs checkout: Updating testtest
cvs add: scheduling file `file.c' for addition
cvs add: use 'cvs commit' to add this file permanently
RCS file: o:\cvs/testtest/file.c,v
done
Checking in file.c;
o:\cvs/testtest/file.c,v  <--  file.c
initial revision: 1.1
done
N testtest/unrelated.c

No conflicts created by this import

C testtest/file.c
U testtest/unrelated.c

1 conflicts created by this import.
Use the following command to help the merge:

 cvs checkout -j<prev_rel_tag> -jrelease-2 testtest

U testtest/file.c
U testtest/unrelated.c
cvs checkout: Updating testtest
cvs update: Updating testtest
cvs update: file testtest/file.c exists, but has been added in revision 
release-2
cvs commit: Examining testtest

This last line is the problem - it didn't find anything to commit.  In
my real situation, there are plenty of other things being commited,
and it is this one added file that is not being dealt with at all.

I think if I add a file on my branch, and I'm trying to join with
another branch who has added the same file, then it should be
a conflict, unless the files are identical.  In this case the files
aren't identical.

And here's the script that I really want to work, with operation
on a branch...

rm -fr //o/cvs/testtest
mkdir //o/cvs/testtest

rm -fr testtest
cvs get -r branch_a testtest
cd testtest
echo hello >file.c
cvs add file.c
cvs commit -m "." file.c
rm -fr CVS
mv file.c unrelated.c
cvs import -m "import" testtest branch_official release-1
cp unrelated.c file.c
echo there >>file.c
cvs import -m "import" testtest branch_official release-2
cd ..
rm -fr testtest
cvs get -r branch_a testtest
cvs update -j release-1 -j release-2
cvs commit -m "merged in release 2"

BFN.  Paul.




reply via email to

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