Merge errors from HEAD to branch

2004-03-16 Thread Christian Robottom Reis

Hello there,

I'm trying to merge a set of changes from HEAD to a branch opened a
while back. The changes I would like to merge were committed to HEAD
between 2 days ago and today; I'll use ChangeLog as an example because
it's a file being actively changed on both HEAD and branch. I have the
file on a branch checkout:

[EMAIL PROTECTED]:~/devel/IC-0.6$ cvs status ChangeLog 
===
File: ChangeLog Status: Up-to-date

   Working revision:1.222.2.5
   Repository revision: 1.222.2.5   /cvs/IndexedCatalog/ChangeLog,v
   Sticky Tag:  INDEXED_CATALOG_0_6_0_branch (branch: 1.222.2)
   Sticky Date: (none)
   Sticky Options:  (none)

Now let's say I want to merge in the referred changes. The way I see it
(as per book and info reading) is:

cvs up -j HEAD:"2 days ago" -j HEAD ChangeLog 

But what I get back is:

cvs update: file ChangeLog exists, but has been added in revision HEAD

and no changes are merged onto the ChangeLog.

I've googled up and down for the error. It *seems* as though the error
results when CVS tries to create the file and sees it already exists in
the branch; however in this case it should definitely be possible to
track the fact that the files in branch and HEAD have a common ancestor
(version 1.222 in fact), and that therefore they are the same file.

Is this a gotcha or am I doing something silly? 

Is there a way to do this type of merge, or must I do it manually? 

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331


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


RE: Merge errors from HEAD to branch

2004-03-16 Thread Jim.Hyslop
Christian Robottom Reis wrote:
> Hello there,
> 
> I'm trying to merge a set of changes from HEAD to a 
> branch opened a
> while back. The changes I would like to merge were committed to HEAD
> between 2 days ago and today; I'll use ChangeLog as an example because
> it's a file being actively changed on both HEAD and branch. I have the
> file on a branch checkout:
> 
> [EMAIL PROTECTED]:~/devel/IC-0.6$ cvs status ChangeLog 
> 
> ===
> File: ChangeLog Status: Up-to-date
> 
>Working revision:1.222.2.5
>Repository revision: 1.222.2.5   
> /cvs/IndexedCatalog/ChangeLog,v
>Sticky Tag:  INDEXED_CATALOG_0_6_0_branch 
> (branch: 1.222.2)
>Sticky Date: (none)
>Sticky Options:  (none)
> 
> Now let's say I want to merge in the referred changes. The 
> way I see it
> (as per book and info reading) is:
> 
> cvs up -j HEAD:"2 days ago" -j HEAD ChangeLog 
HEAD has a specific meaning - it means "the latest revision on the trunk
[footnote]". Because you have specified an exact revision, the date
component will be ignored (the date component can only be used with a
_branch_ tag), so your command boils down to:

  cvs up -j HEAD -j HEAD

which tells CVS "Take the difference between revision 'HEAD' and revision
'HEAD', and apply that difference to my local file." Since the two revisions
are identical, there is no difference and nothing to apply.

If this is the first time you are merging (which I strongly suspect, given
your question), then CVS will use the ancestor revision (in the specific
example you provided, 1.222) as the implied starting point, allowing you to
use only one tag:

cvs up -j HEAD

This will be the equivalent of:
cvs up -j INDEXED_CATALOG_0_6_0 -j HEAD

(assuming that you have a non-branch tag called INDEXED_CATALOG_0_6_0
applied to the branch point).

After you have completed the merge, you need to apply a tag so that, on the
next merge, you can specify *which* revisions need to be applied:

cvs tag -rHEAD INDEXED_CATALOG_0_6_0_branch_last_merge

Then, the next time you merge, the commands will be:

cvs up -j INDEXED_CATALOG_0_6_0_branch_last_merge -j HEAD
[fix up any conflicts, then check in]
cvs tag -F -rHEAD INDEXED_CATALOG_0_6_0_branch_last_merge


[Footnote] There is one exception - for the 'diff' command, HEAD means "the
most recent revision in the currently-checked-out branch".


-- 
Jim Hyslop
Senior Software Designer
Leitch Technology International Inc. (http://www.leitch.com)
Columnist, C/C++ Users Journal (http://www.cuj.com/experts)





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


Re: Merge errors from HEAD to branch

2004-03-24 Thread Christian Robottom Reis
On Tue, Mar 16, 2004 at 11:08:27AM -0500, Jim.Hyslop wrote:
> > Now let's say I want to merge in the referred changes. The 
> > way I see it
> > (as per book and info reading) is:
> > 
> > cvs up -j HEAD:"2 days ago" -j HEAD ChangeLog 
> HEAD has a specific meaning - it means "the latest revision on the trunk
> [footnote]". Because you have specified an exact revision, the date
> component will be ignored (the date component can only be used with a
> _branch_ tag), so your command boils down to:
> 
>   cvs up -j HEAD -j HEAD
> 
> which tells CVS "Take the difference between revision 'HEAD' and revision
> 'HEAD', and apply that difference to my local file." Since the two revisions
> are identical, there is no difference and nothing to apply.
> 
> If this is the first time you are merging (which I strongly suspect, given
> your question), then CVS will use the ancestor revision (in the specific

Hmm. My situation was a bit peculiar: I wanted to merge in *only* the
changes that were done in the last 2 days, ignoring changes done before
that (which is why I specified the date modifier to HEAD); I still don't
see how I can do that easily (without specifying tags to delimit the
merge?). 

Perhaps CVS doesn't allow you to merge arbitrary timeslices of your tree
without having specific tags to merge against; perhaps it's silly anyway
to assume it would let you merge only a subset of the changes done to
HEAD since the branch (given the chance that you're going to mess up is
large since you're not respecting the historical evolution of the tree).

I ended up just generating a diff of everything changes in the past two
days and merging it in manually, but I would love to know if there's a
"more correct" solution.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331


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


RE: Merge errors from HEAD to branch

2004-03-24 Thread Jim.Hyslop
Christian Robottom Reis wrote:
> On Tue, Mar 16, 2004 at 11:08:27AM -0500, Jim.Hyslop wrote:
> > > Now let's say I want to merge in the referred changes. The 
> > > way I see it
> > > (as per book and info reading) is:
> > > 
> > > cvs up -j HEAD:"2 days ago" -j HEAD ChangeLog 
> > HEAD has a specific meaning - it means "the latest revision 
> on the trunk
> > [footnote]". Because you have specified an exact revision, the date
> > component will be ignored (the date component can only be 
> used with a
> > _branch_ tag), so your command boils down to:
> > 
> >   cvs up -j HEAD -j HEAD
> > 
> > which tells CVS "Take the difference between revision 
> 'HEAD' and revision
> > 'HEAD', and apply that difference to my local file." Since 
> the two revisions
> > are identical, there is no difference and nothing to apply.
> > 
> > If this is the first time you are merging (which I strongly 
> suspect, given
> > your question), then CVS will use the ancestor revision (in 
> the specific
> 
> Hmm. My situation was a bit peculiar: I wanted to merge in *only* the
> changes that were done in the last 2 days, ignoring changes 
> done before
> that (which is why I specified the date modifier to HEAD); I 
> still don't
> see how I can do that easily (without specifying tags to delimit the
> merge?). 
You might try using

 -j1:date_spec

If it works, '1' would mean 'the trunk'. I have no idea if it will actually
work.

> Perhaps CVS doesn't allow you to merge arbitrary timeslices 
> of your tree
> without having specific tags to merge against;
Doesn't appear that way. But, you can apply a tag using a date spec - so you
could:

cvs tag -r "two days ago" start_point
cvs up -j start_point -jHEAD

(note: I don't use the date specs very often, so "two days ago" may not be a
valid date spec).

-- 
Jim Hyslop
Senior Software Designer
Leitch Technology International Inc. (http://www.leitch.com)
Columnist, C/C++ Users Journal (http://www.cuj.com/experts)




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