info-cvs
[Top][All Lists]
Advanced

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

Re: cleanly replacing the trunk (but keeping one branch)


From: Jim Hyslop
Subject: Re: cleanly replacing the trunk (but keeping one branch)
Date: Mon, 29 Aug 2005 10:24:25 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Sergei Organov wrote:
Jim Hyslop <address@hidden> writes:


Jim Hyslop wrote:

Nikita Tovstoles wrote:
[...]


checked into the repository.  What I'd like to do now,
is to keep the branch as it is, but completely remove
the trunk and replace it with all the new code that is
on my laptop at the moment. I've been the only
commiter so far. How can I do that?
[...]
As far as I understood, the OP doesn't want to replace the HEAD with the
branch, and that's what the above commands do, right? For me it seems
that the OP wanted to replace the HEAD with his modified files that he
initially got from the HEAD, so it sounds more like regular commit (with
a lot of changes/ file renames).

Yes, I think you may be right. I made a bad assumption, that the code on the laptop was on the branch.

Nikita, here is a revised sequence of commands that will do what you want. This sequence will work regardless of whether your laptop's code is checked out from the trunk or from a branch. **NOTE** Any changes you may have checked into the trunk from a different location (i.e. a different computer, or a different working directory on your laptop) will be discarded!

All commands are issued from the base directory of your project, on your laptop. Using UNIX-style comments to explain what's going on:

# First, for safety's sake, check in all working code in the
# current directory into a temporary branch. IMPORTANT: you must
# use the 'cvs tag' command, NOT the 'cvs rtag' command.
cvs tag before-major-checkin
cvs tag -b before-major-checkin-branch

# Now, switch to the branch.
cvs update -r before-major-checkin-branch

# at this point, you are now working on a temporary branch.
# Code can be safely checked in, and it will not require
# any updates nor merges.

# 'cvs add' all new files and 'cvs remove' all obsolete files. This step
# is not strictly necessary, but it will ensure that the temporary
# branch is a complete, accurate snapshot of your working directory.
cvs add [as required]
cvs remove [as required]

# Commit the code to the branch. There
# should be no errors or warnings on this commit.
cvs commit

# At this point, all your changes are safely stored in CVS.

# Now, we go back and do the sequence mentioned earlier.
# First, update to the trunk:
cvs update -A

# Now, pull the code off the temporary branch into the current working
# directory:
cvs update -j HEAD -j before-major-checkin-branch

# The following line should produce absolutely no output:
cvs -q di -r before-major-checkin-branch

# Verify that all files are correct. Once you are satisfied that it
# worked properly:
cvs commit

--
Jim





reply via email to

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