Kedal Occasionally, you may need to set a lock in an archive file without checking out a working file. If you name only an RCS file without a pathname prefix such as workfile,vthe command tries to use workfile,v first in any RCS subdirectory beneath the current directory, then in the applying directory itself. Applying RCS and SCCS RCS file name, working file name, head the number of the latest revision on the trunkdefault branch, access list, locks, symbolic names, number of revisions and descriptive text. Now that you have the lock, you have the exclusive right to change this revision revision 1. Then applyibg will echo the commands it normally would run but will not actually execute them.
|Published (Last):||15 January 2017|
|PDF File Size:||11.92 Mb|
|ePub File Size:||16.35 Mb|
|Price:||Free* [*Free Regsitration Required]|
You extract a working file from an existing RCS file with the command co for "check-out". The co 1 command is designed to be the mirror-image of ci 1. So, once again, in the simplest case you specify nothing but a filename when you run the command. Here, the output from the command confirms that revision 1. If a writable copy of xform. CAUTION: As we said in Chapter 2, co will silently overwrite any read-only copy of a file that already exists with the same name as a working file it wants to check out, on the assumption that the existing file is the result of a previous co for reading.
So if a file is under source control, do not try to maintain changed copies of it manually i. First of all, you can use the -f option to "force" co to create a working file even if a writable file of the same name already exists.
You might use -f if you had copied some outdated copy of the file into your work area but now wanted to overwrite it with a current copy from the archive file. At the other extreme, you can check out a revision without affecting any file that already exists with the same name, by using the -p option. With -p, co will "print" the checked-out revision to its standard output, rather than putting it into a working file.
You can then redirect standard output to capture the file in whatever way is appropriate. You might use -p if you wanted to have more than one revision of a file checked out simultaneously--you could check out all but one revision with -p into files with special names.
Of course, -p is purely a convenience. You can always avoid using it by doing regular check-outs and renaming the working files afterward. To check out xform. As you can see, the current output confirms that a lock has been set on the revision of xform. Now that you have the lock, you have the exclusive right to change this revision revision 1. If someone else already held the lock to revision 1.
If, for example, you requested the lock for revision 1. The check-out is aborted unconditionally. The error message points out what user owns the lock, which lets you contact him if you absolutely need to modify the file now. Perhaps he can check it back in. Occasionally, you may need to set a lock in an archive file without checking out a working file. Checking out working files would overwrite the new sources with the older ones. To set a lock without creating a working file, use the command rcs -l.
Having a lock set in each archive file will enable you to check in the corresponding newly imported source file as a successor to the existing revision you locked. To compare a working file against the RCS file it came from, use the rcsdiff 1 program. The diff output will show the original revision as the "old" file being compared and the current working file as the "new" file being compared.
You can also use rcsdiff to compare a working file against some revision other than the one it started from or to compare two different RCS file revisions to each other. For instance, to compare the current contents of xform. This form of rcsdiff can be particularly useful for debugging, since it lets you see recent changes to the file other than your own.
This is, of course, the same command you used to create the RCS file in the first place; ordinarily, to check in a working file, you give the same simple command line as you did then. Sometimes, you may prefer to give revision commentary directly on the ci command line. Ordinarily, ci expects a newly checked-in revision to be different from its ancestor and will not complete the check-in if the two are identical.
You can use the -f option to "force" a check-in to complete anyway in this case. By default, ci deletes your working file when the check-in is complete. To make ci do an immediate check-out of the working file after checking it in, you can add either of two options to the command line.
The -u option will check out your working file unlocked, suitable for read-only use. The -l option will set a new lock on the revision that you just checked in and check out the working file for modification. Both of these options are simply shorthand for doing a separate co following the check-in. If you want to remove the working file, you have to do that yourself with rm 1.
This command, for instance, would unlock revision 1. The -u option causes co to unlock the checked-out revision if it was locked by you, while -f forces co to overwrite your writable working file with the original revision from the archive file. The descriptions can be displayed by using the rlog 1 command. As usual, you simply give on the command line the name of the file you want to examine.
Next, following the description: line, we find the text entered when the RCS file was first created. Last, a list of revision entries appears, one for each revision in the RCS file. These entries are output with the most recent first. Each one contains the description that was originally entered for that revision. This program compares working files in the current directory against their archive files and removes working files that were checked out but never modified.
More specifically: A working file that was checked out for reading is removed only if it still matches the head revision on the default branch of the archive file. If -u is given, a working file that was checked out for modification is removed if it still matches the original revision that is, the one checked out locked by the user. If a working file does not match the revision noted in the last two cases, then rcsclean will never remove it. When -u is given, if rcsclean removes a working file, it also removes any lock corresponding to it.
If you invoke rcsclean with no arguments, it will process all of the working files in the current directory. If you provide arguments, then only the working files you name will be processed. Needless to say, rcsclean has no effect on files other than working files checked out from an RCS file. If you want to see what commands rcsclean would execute, if given a certain command line, you can use the -n flag.
Then rcsclean will echo the commands it normally would run but will not actually execute them. Note that the output from rcsclean -n looks exactly like the normal output, so be careful not to confuse a -n run with the real McCoy.
You can put and keep files under source control with RCS by using only two commands, ci and co. This simplicity is a strong point of the system. Finally, we presented rcsclean to remove unmodified working files. Table 3.
Applying RCS and SCCS
You extract a working file from an existing RCS file with the command co for "check-out". The co 1 command is designed to be the mirror-image of ci 1. So, once again, in the simplest case you specify nothing but a filename when you run the command. Here, the output from the command confirms that revision 1. If a writable copy of xform. CAUTION: As we said in Chapter 2, co will silently overwrite any read-only copy of a file that already exists with the same name as a working file it wants to check out, on the assumption that the existing file is the result of a previous co for reading. So if a file is under source control, do not try to maintain changed copies of it manually i.
APPLYING RCS AND SCCS PDF
Mikasar Same as entering rmdel followed by edit. Removes from your directory all files that can be regenerated from the named s-file. We provide instructions for doing so in Appendix H, References. If you want to use the message actually to capture some useful data, you can use the -m option on the ci command line to specify it, like this:. RCS — Revision Control System This form of rcsdiff can be particularly useful for debugging, since it lets you see recent changes to the file other than your own.