info-cvs
[Top][All Lists]
Advanced

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

Re: cvs checkout merging with non-cvs source


From: Eric Siegerman
Subject: Re: cvs checkout merging with non-cvs source
Date: Wed, 17 Jan 2001 17:14:10 -0500
User-agent: Mutt/1.2.5i

On Wed, Jan 17, 2001 at 12:17:30PM -0800, James Shannon wrote:
>    My group develops add-ons and custom solutions to a set of pre-developed
> sourcecode and I'm wondering if there is an easy way to checkout our custom
> solutions from CVS and merge them with the pre-developed source tree.
> [...]
> The idea is to have a CVS repository with only the new/modified files:

This is exactly what the vendor branch is for!  Let CVS manage
the whole thing, including the pre-developed source.  When you
get a new distribution of the latter, you'll be glad you did!

In the following, I assume you have a directory with the latest
and greatest (non-cvsified) source, ie. the pre-developed source
plus all your changes to date; I call this <current>.

  - make sure <current> doesn't contain any "CVS" directories
    (eg. left over from any previous attempts to CVSify it)

  - "cvs import" a vanilla copy of the pre-developed source
    distribution -- this MUST be a vanilla copy, without any of
    your local changes

  - "cvs co" the same (the resulting working directory is
    hereafter referred to as <sandbox>)

  - get a list of the files you've deleted from the distribution:
      % cd <sandbox>; find . -print | sort >/tmp/vanilla
      % cd <current>; find . -print | sort >/tmp/current
      % comm -23 vanilla current >/tmp/deleted-files

  - recursively copy <current> (new files, modified files,
    unmodified files -- the whole works) OVER TOP OF your new
    sandbox; this will result in the sandbox containing your
    latest and greatest source, but with its CVS admin info
    pertaining to the vanilla distribution (not quite -- any
    files you've locally deleted will still be present; we'll
    deal with this momentarily)

  - Now "cd <sandbox>; cvs -nq update" will give you a complete
    list of the files you've added (flagged by "?") and changed
    (flagged by "M") -- but NOT the ones you've deleted, which is
    why you had to make a list of those before overlaying the
    two directories

  - "cvs add" any of the "?"-flagged files that should be
    CVS-tracked (exclude any cruft that's made it into <current>
    -- temporary files that people forgot to delete, etc.) 

  - "cvs remove -f" the files you've deleted from the
    distribution, ie. the ones in the list you made above (though
    of course you'll want to verify that none of them were
    deleted by accident in the distant past :-)

  - "cvs commit"

> when we want to bring a pre-developed source tree to the modified state,
> we'd move to the root, issue checkout, and CVS would recurse through and add
> the two new files(newfile.pm and new-shared-file.pm) and update the two
> modified files(catalog.pm and Shared.pm). All other files it would leave
> alone. It would also add the necessary CVS directories so that we could do
> add's and commit's when need be.

You'll end up with functionally this result, though by a
different path than you'd imagined.

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
Interviewer: You've been looking at the stars all your life:
Is there anything in astrology?
Arthur C. Clarke: It's utter nonsense.  But I'm a Sagittarius,
so I'm naturally skeptical.



reply via email to

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