[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Best method to replace a branch's code
From: |
Derek Robert Price |
Subject: |
Re: Best method to replace a branch's code |
Date: |
Wed, 24 Mar 2004 12:13:40 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Larry Jones wrote:
>Derek Robert Price writes:
>
>>cvs up -jbranchA -jbranchB -rbranchA project
>
>
>Isn't that just a long way of doing:
>
> cvs up -rbranchA -jbranchB project
>
>That was my first thought, but it still may require a bit of manual
>intervention. For example, that won't delete files that exist on
>branchA that have never existed on branchB and you'll get conflicts for
>files that were independently created on both branches. It is a good
>start, though, and may do the whole job if you're lucky.
No. The trick to thinking about this is really to visualize only your
destination and your merge endpoints as three distinct snapshots of a
project in time and try to ignore the intervening changes, but I will
draw the branch diagram anyhow. Assume:
- --X---Y--------------------------------------
\ \
\ \----------branchA-----
\
\--------branchB-----
`cvs up -rbranchA -jbranchB' will compute the GCA of branchA & branchB
(X in the diagram), computes the diff from X to the tip of branchB, then
merges the result (effectively applying it via the patch program) into
branchA. This is effectively merging the changes since branchB branched
into branchA and neglecting to remove any changes made to the trunk
since branchB branched or to branchA.
`cvs up -rbranchA -jbranchA -jbranchB', computes the diff from the tip
of branchA to the tip of branchB, then merges the result (again,
effectively applying it via the patch program) into the tip of branchA,
effectively recreating branchB.
In other words, imagine:
echo a whole bunch of junk >file
cp file file2
echo some other junk >>file2
diff -u file file2 >mypatch.diff
patch -p0 <mypatch.diff
Bingo. Since the diff was determine from file -> file2, then the
resulting patch applied to file, the contents of file now look like file2.
Derek
- --
*8^)
Email: address@hidden
Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org
iD8DBQFAYcHDLD1OTBfyMaQRAotOAJ98AHRD3TWxVzv0G6TJxzqEITjwcgCfbtmt
MGps73FhRpKv17Ev2cXwrB8=
=OncB
-----END PGP SIGNATURE-----
- Best method to replace a branch's code, Euan Guttridge, 2004/03/24
- RE: Best method to replace a branch's code, Fouts Christopher (6452), 2004/03/24
- RE: Best method to replace a branch's code, Fouts Christopher (6452), 2004/03/24
- RE: Best method to replace a branch's code, Euan Guttridge, 2004/03/24
- RE: Best method to replace a branch's code, Euan Guttridge, 2004/03/24
- Re: Best method to replace a branch's code, Derek Robert Price, 2004/03/24
- Re: Best method to replace a branch's code, Larry Jones, 2004/03/24
- Re: Best method to replace a branch's code,
Derek Robert Price <=
- Re: Best method to replace a branch's code, Derek Robert Price, 2004/03/24
- Re: Best method to replace a branch's code, Derek Robert Price, 2004/03/24
- Re: Best method to replace a branch's code, Larry Jones, 2004/03/24
- Strange Characters, Gagneet Singh, 2004/03/25
- Re: Strange Characters, Mark D. Baushke, 2004/03/25
- RE: Strange Characters, Gagneet Singh, 2004/03/25
RE: Best method to replace a branch's code, Fouts Christopher (6452), 2004/03/24
RE: Best method to replace a branch's code, Fouts Christopher (6452), 2004/03/24
RE: Best method to replace a branch's code, Andy Jones, 2004/03/24
RE: Best method to replace a branch's code, Jim.Hyslop, 2004/03/24