comparison man/internals/internals.texi @ 3059:23046b62bf91

[xemacs-hg @ 2005-11-13 07:29:31 by ben] branch info in internals manual internals/internals.texi: Add node on Creating a Branch. Update info concerning problems with rtag on symlinks. (#### Is this still valid?)
author ben
date Sun, 13 Nov 2005 07:29:34 +0000
parents fcf2f05d0c7a
children 0ae46b360391
comparison
equal deleted inserted replaced
3058:169e54cd08c3 3059:23046b62bf91
391 * How to Regression-Test:: 391 * How to Regression-Test::
392 * Modules for Regression Testing:: 392 * Modules for Regression Testing::
393 393
394 CVS Techniques 394 CVS Techniques
395 395
396 * Creating a Branch::
396 * Merging a Branch into the Trunk:: 397 * Merging a Branch into the Trunk::
397 398
398 Low-Level Allocation 399 Low-Level Allocation
399 400
400 * Basic Heap Allocation:: 401 * Basic Heap Allocation::
6530 @node CVS Techniques, XEmacs from the Inside, Regression Testing XEmacs, Top 6531 @node CVS Techniques, XEmacs from the Inside, Regression Testing XEmacs, Top
6531 @chapter CVS Techniques 6532 @chapter CVS Techniques
6532 @cindex CVS techniques 6533 @cindex CVS techniques
6533 6534
6534 @menu 6535 @menu
6536 * Creating a Branch::
6535 * Merging a Branch into the Trunk:: 6537 * Merging a Branch into the Trunk::
6536 @end menu 6538 @end menu
6537 6539
6538 @node Merging a Branch into the Trunk, , CVS Techniques, CVS Techniques 6540 @node Creating a Branch, Merging a Branch into the Trunk, CVS Techniques, CVS Techniques
6541 @section Creating a Branch
6542 @cindex creating a branch
6543 @cindex branch, creating
6544
6545 This assumes that you have an existing workspace modified off of the
6546 main line, and you want to put it onto a branch.
6547
6548 @enumerate
6549 @item
6550 Preliminary comment: @emph{All} commands are to be executed at the
6551 top level of your workspace, unless otherwise indicated (which will be
6552 rare, if ever). Don't ever forget this and screw up, or you will get a real
6553 mess.
6554
6555 @item
6556 First, make a backup copy of your entire repository using @code{cp -a}
6557 (in the directory above your repository!) before doing anything.
6558
6559 @item
6560
6561 Now, rule #1: @strong{Never try to create a branch from a workspace
6562 with added or deleted files.} If you are lucky, the operation will
6563 simply fail. If you are less lucky, it will proceed, but make the
6564 adds and deletes on the main line, which you do not want at all.
6565 Therefore, you must undo all adds and deletes. To find out what is
6566 added and deleted, use something like @code{cvs -n update >&!
6567 cvs.out}, which does a "dry run". (You did make a backup copy first,
6568 right? What if you forgot the @samp{-n}, for example, and wasn't
6569 prepared for the sudden onslaught of merging action?) Take a look at
6570 the output file @file{cvs.out} and check very carefully for newly
6571 added files (marked with an @samp{A}) and newly removed files (marked
6572 with an @samp{R}). Double check that your newly added files are in
6573 your backup copy, then @code{rm} and @code{crw rm} each of them to
6574 undo the addition. For each removed file, do @code{crw add} to undo
6575 the removal.
6576
6577 @item
6578 create a branch point. (This is a tag marking the point at which
6579 your branch split from the main line. It is @strong{extremely}
6580 important to create such a branch point! The creation of the actual
6581 branch only creates a tag that marks the end of the branch, which will
6582 move as you check in changes to your branch. The CVS designers, in
6583 their infinite wisdom, didn't provide any automatic mechanism for
6584 tracking the branching point, so you need to do it manually.)
6585
6586 @example
6587 crw tag ben-mule-21-5-bp
6588 @end example
6589
6590 @item
6591 Next, create the actual branch:
6592
6593 @example
6594 crw tag -b ben-mule-21-5
6595 @end example
6596
6597 Note that this doesn't actually do anything to your local workspace!
6598 It basically just creates another tag in the repository, identical to
6599 the branch point tag but internally marked as a "branch tag" rather
6600 than a regular tag.
6601
6602 @item
6603 Now, move your workspace onto the branch:
6604
6605 @example
6606 cvs update -r ben-mule-21-5
6607 @end example
6608
6609 For unknown reasons, this may generate conflicts for each file that
6610 you have modified locally. If so, you can fix this by touching the
6611 conflicting files (the conflicts are bogus if you followed the above
6612 procedure). Run the following command in the top-level directory:
6613
6614 @example
6615 cvs-mods | xargs touch --no-create
6616 @end example
6617
6618 @item
6619 Now, carefully redo all adds and deletes; refer to the @file{cvs.out}
6620 file to remember what needs to be redone.
6621
6622 @item
6623 Now, check in the files on the branch:
6624
6625 @example
6626 crw commit -m "first commit of ben-mule-21-5 branch"
6627 @end example
6628 @end enumerate
6629
6630 @node Merging a Branch into the Trunk, , Creating a Branch, CVS Techniques
6539 @section Merging a Branch into the Trunk 6631 @section Merging a Branch into the Trunk
6540 @cindex merging a branch into the trunk 6632 @cindex merging a branch into the trunk
6633 @cindex branch, merging into the trunk
6634
6635 Preliminary comment: Beware of the symlink problem with `cvs rtag':
6636
6637 @example
6638 cvs [rtag aborted]: received abort signal
6639 cvs [rtag aborted]: received abort signal
6640 lock.c:178: failed assertion `strncmp (repository, current_parsed_root->directory, strlen (current_parsed_root->directory)) == 0'
6641 lock.c:178: failed assertion `strncmp (repository, current_parsed_root->directory, strlen (current_parsed_root->directory)) == 0'
6642 @end example
6643
6644 It will fail with a message like this if the directory component of
6645 your root (CVSROOT environment variable or `-d' option) is a symbolic
6646 link, which is the case for the standard /pack/xemacscvs. You need to
6647 find the real directory name; one trick is to execute a command that
6648 attempts to write to the repository, using read-only access. This
6649 will output an error message showing the actual repository directory.
6541 6650
6542 @enumerate 6651 @enumerate
6543 @item 6652 @item
6544 If you haven't already done a merge, you will be merging from the branch 6653 If you haven't already done a merge, you will be merging from the branch
6545 point; otherwise you'll be merging from the last merge point, which 6654 point; otherwise you'll be merging from the last merge point, which
6546 should be marked by a tag, e.g. @samp{last-sync-ben-mule-21-5}. In the 6655 should be marked by a tag, e.g. @samp{last-sync-ben-mule-21-5}. In the
6547 former case, create the last-sync tag, e.g. 6656 former case, create the last-sync tag, e.g.
6548 6657
6549 @example 6658 @example
6550 crw rtag -r ben-mule-21-5-bp last-sync-ben-mule-21-5 xemacs 6659 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
6551 @end example 6660 @end example
6552 6661
6553 (You did create a branch point tag when you created the branch, didn't 6662 (You did create a branch point tag when you created the branch, didn't
6554 you?) 6663 you?)
6555 6664
6665 Note the way this command is specified, overriding the root to avoid
6666 the symlink problem, as described above.
6667
6556 @item 6668 @item
6557 Check everything in on your branch. 6669 Check everything in on your branch.
6558 6670
6559 @item 6671 @item
6560 Tag your branch with a pre-sync tag, e.g. 6672 Tag your branch with a pre-sync tag, e.g.
6561 6673
6562 @example 6674 @example
6563 crw rtag -r ben-mule-21-5 ben-mule-21-5-pre-feb-20-2002-sync xemacs 6675 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
6564 @end example 6676 @end example
6565 6677
6566 Note, you need to use rtag and specify a version with @samp{-r} (use 6678 Note, you need to use rtag and specify a version with @samp{-r} (use
6567 @samp{-r HEAD} if necessary) so that removed files are handled correctly 6679 @samp{-r HEAD} if necessary) so that removed files are handled correctly
6568 in some obscure cases. See section 4.8 of the CVS manual. 6680 in some obscure cases. See section 4.8 of the CVS manual.
6570 @item 6682 @item
6571 Tag the trunk so you have a stable place to merge up to in case people 6683 Tag the trunk so you have a stable place to merge up to in case people
6572 are asynchronously committing to the trunk, e.g. 6684 are asynchronously committing to the trunk, e.g.
6573 6685
6574 @example 6686 @example
6575 crw rtag -r HEAD main-branch-ben-mule-21-5-syncpoint-feb-20-2002 xemacs 6687 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
6576 crw rtag -F -r main-branch-ben-mule-21-5-syncpoint-feb-20-2002 next-sync-ben-mule-21-5 xemacs 6688 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
6577 @end example 6689 @end example
6578 6690
6579 Use -F in the second case because the name might already exist, e.g. if 6691 Use -F in the second case because the name might already exist, e.g. if
6580 you've already done a merge. We make two tags because one is a 6692 you've already done a merge. We make two tags because one is a
6581 permanent mark indicating a syncpoint when merging, and the other is a 6693 permanent mark indicating a syncpoint when merging, and the other is a
6603 6715
6604 @item 6716 @item
6605 Tag your branch with a post-sync tag, e.g. 6717 Tag your branch with a post-sync tag, e.g.
6606 6718
6607 @example 6719 @example
6608 crw rtag -r ben-mule-21-5 ben-mule-21-5-post-feb-20-2002-sync xemacs 6720 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
6609 @end example 6721 @end example
6610 6722
6611 @item 6723 @item
6612 Update the last-sync tag, e.g. 6724 Update the last-sync tag, e.g.
6613 6725
6614 @example 6726 @example
6615 crw rtag -F -r next-sync-ben-mule-21-5 last-sync-ben-mule-21-5 xemacs 6727 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
6616 @end example 6728 @end example
6617 @end enumerate 6729 @end enumerate
6618 6730
6619 6731
6620 @node XEmacs from the Inside, Basic Types, CVS Techniques, Top 6732 @node XEmacs from the Inside, Basic Types, CVS Techniques, Top