[smc] [snip]
[smc] [..regarding "cvs update -j rev1 -j rev2 myfile.c" ]
> >
> > rev1 and rev2 can be arbitrary revisions. (Well, with the
> > restriction
> > that they must already be in the same repository...which is
> > the main difference I see from the proposed "cvs patch".
>
> That, plus that 'cvs patch' permits any tool to create patch files.
> I could, for example, get a diff from another source code system, or from
> another user elsewhere. Might not even be based on the same file.
[smc] Hmm it seems to me then, just use patch. I'm no expert on
patch though, perhaps it has inadequacies that make it unsuitable.
[snip]
> (Incidentally, does update -j -j work if the two revisions are not on
> related
> branches?
[smc] the two revisions may be any arbitrary revisions, just as
you
can feed any arbitrary patch into the patch program, doesn't mean it
will
work nicely.
> What if there is a conflict between the two revisions, as well as a
> conflict in
> your own code in applying this? (all three versions do different things to
> one
> area).) [smc] There can't be a "conflict between the two revisions."
> You
have to have at least 3 revisions before a conflict is possible...so
I'm not
sure what you mean.
When you do "cvs update -j rev1 -j rev2 myfile.c", it is very much
like
(identical to?) doing
diff -c myfile.c.rev1 myfile.c.rev2 | patch myfile.c
>
> [smc] [snip]
>
> Now, if 'branch2' (the new) is a descendant of 'branch1' (the old), and I
> want
> a script to automatically go up one level of branching, how do I do that?
[smc] Sorry, I don't know what you mean by "go up one level of
branching"
> cvs update -A removes all branches, back to the trunk.
[smc] Hmm. I never use "-A", I always work on branches, so
I never use the trunk, except when merging to the trunk for the
purpose
of creating a new branch.. so I'm afraid I can't help much there.
> How do I say 'Look in CVS/Tag, find the place where this branch came from,
> and go to that branch or trunk'?
[smc] "place where this branch came from?" I think you mean what
branch
did this branch branch off of? Which might be different on a
file-by-file basis...
(a pathological case, to be sure.) I don't think you can do that.
Or know why
you'd want to... what are you trying to accomplish?
> And, my first question is still there: if I have some files that are
> modified,
> and I do a 'cvs update -r new-revision', I'll move over to new revision;
> if
> files are modified, then any changes will get merged in.
>
> How do I say 'only permit this update -r if my (modified) files are
> current for
> the new location? (no merge needed)
[smc] If I understand correctly...
You are working away on some branch, branchA, say, and you want to
start working on branchB, but you don't want to blow away mods you
have
made (but not committed) to your branchA sandbox... is that it?
Can't do it, not that way. (I can't think of a way, at least)
Hmm. you could do "cvs -nq update" to see what files have
been modified, then do "chmod -w" on those files prior to the
"cvs update"... I don't know if cvs update would puke and die
or just issue warnings for the files it couldn't write.
Here's one different way:
cvs co -r branchA everything
cd everything
cvs tag start_of_hacking
(hack away on files)
cvs commit
cvs tag end_of_hacking
cd ..
rm -fr everything
cvs co -r branchB everything
cd everything
cvs update -d -P -j start_of_hacking -j end_of_hacking
This will make the same changes you just made to
BranchA on your BranchB sandbox.
But that doesn't guarantee the modified files are _the same_ as
what they were on BranchA. (why would you want that though?
You'd be (potentially) blowing away other's changes on branchB.)
Also doesn't guarantee absence of conflicts... so it's probably
not what you want.
-- steve