| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section is obsolete for core XEmacs; we now use Mercurial 13. Mercurial Techniques. However these may be of some use for the packages, which are still in CVS for the moment.
| 14.1 Creating a Branch | ||
| 14.2 Merging a Branch into the Trunk |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This assumes that you have an existing workspace modified off of the main line, and you want to put it onto a branch.
cp -a
(in the directory above your repository!) before doing anything.
Now, rule #1: Never try to create a branch from a workspace
with added or deleted files. If you are lucky, the operation will
simply fail. If you are less lucky, it will proceed, but make the
adds and deletes on the main line, which you do not want at all.
Therefore, you must undo all adds and deletes. To find out what is
added and deleted, use something like cvs -n update >&!
cvs.out, which does a "dry run". (You did make a backup copy first,
right? What if you forgot the `-n', for example, and wasn't
prepared for the sudden onslaught of merging action?) Take a look at
the output file `cvs.out' and check very carefully for newly
added files (marked with an `A') and newly removed files (marked
with an `R'). Double check that your newly added files are in
your backup copy, then rm and crw rm each of them to
undo the addition. For each removed file, do crw add to undo
the removal.
crw tag ben-mule-21-5-bp |
crw tag -b ben-mule-21-5 |
Note that this doesn't actually do anything to your local workspace! It basically just creates another tag in the repository, identical to the branch point tag but internally marked as a "branch tag" rather than a regular tag.
cvs update -r ben-mule-21-5 |
For unknown reasons, this may generate conflicts for each file that you have modified locally. If so, you can fix this by touching the conflicting files (the conflicts are bogus if you followed the above procedure). Run the following command in the top-level directory:
cvs-mods | xargs touch --no-create |
crw commit -m "first commit of ben-mule-21-5 branch" |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Preliminary comment: Beware of the symlink problem with `cvs rtag':
cvs [rtag aborted]: received abort signal cvs [rtag aborted]: received abort signal lock.c:178: failed assertion `strncmp (repository, current_parsed_root->directory, strlen (current_parsed_root->directory)) == 0' lock.c:178: failed assertion `strncmp (repository, current_parsed_root->directory, strlen (current_parsed_root->directory)) == 0' |
It will fail with a message like this if the directory component of your root (CVSROOT environment variable or `-d' option) is a symbolic link, which is the case for the standard /pack/xemacscvs. You need to find the real directory name; one trick is to execute a command that attempts to write to the repository, using read-only access. This will output an error message showing the actual repository directory.
cvs -d :ext:xemacs@cvs.xemacs.org:/mnt/home1/cvsroots/xemacscvs rtag -r ben-mule-21-5-bp last-sync-ben-mule-21-5 xemacs |
(You did create a branch point tag when you created the branch, didn't you?)
Note the way this command is specified, overriding the root to avoid the symlink problem, as described above.
cvs -d :ext:xemacs@cvs.xemacs.org:/mnt/home1/cvsroots/xemacscvs rtag -r ben-mule-21-5 ben-mule-21-5-pre-feb-20-2002-sync xemacs |
Note, you need to use rtag and specify a version with `-r' (use `-r HEAD' if necessary) so that removed files are handled correctly in some obscure cases. See section 4.8 of the CVS manual.
cvs -d :ext:xemacs@cvs.xemacs.org:/mnt/home1/cvsroots/xemacscvs rtag -r HEAD main-branch-ben-mule-21-5-syncpoint-feb-20-2002 xemacs cvs -d :ext:xemacs@cvs.xemacs.org:/mnt/home1/cvsroots/xemacscvs rtag -F -r main-branch-ben-mule-21-5-syncpoint-feb-20-2002 next-sync-ben-mule-21-5 xemacs |
Use -F in the second case because the name might already exist, e.g. if you've already done a merge. We make two tags because one is a permanent mark indicating a syncpoint when merging, and the other is a symbolic tag to make other operations easier.
cp -a mule mule-backup-2-23-02 |
cvs update -j last-sync-ben-mule-21-5 -j next-sync-ben-mule-21-5 |
cvs -d :ext:xemacs@cvs.xemacs.org:/mnt/home1/cvsroots/xemacscvs rtag -r ben-mule-21-5 ben-mule-21-5-post-feb-20-2002-sync xemacs |
cvs -d :ext:xemacs@cvs.xemacs.org:/mnt/home1/cvsroots/xemacscvs rtag -F -r next-sync-ben-mule-21-5 last-sync-ben-mule-21-5 xemacs |
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |