Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

XENIX Programming SCCS: Source Code Control System prints all information about versions that precede version 1.4 (e.g., 1.3, 1.2, and 1.1). The command prs -r1.4 -1 s.abc prints information about versions that succeed version 1.4 (e.g., 1.5, 1.6, and 2.1). If both options are given, information about all versions is printed. Editing by Several Users SCCS allows any nu mber of users to access and edit versions of a given s-file. Since users are likely to access the s-file at the same time, the system is designed to allow concurrent editing of different versions. Normally, the system prevents concurrent editing of the same version, but you can change the operation of the system to allow concurrent editing of the same version by setting the j flag in the given s-file. The following sections explain how to perform concurrent editing and how to save edited versions when you have retrieved more than one version for editing. Editing Different Versions sees allows several different versions of a file to be edited at the same time. This means a user can edit version 2.1 while another user edits version 1.1. There is no limit to the number of versions that can be edited at any given time. When several users edit different versions concurrently, each user must begin work in his own directory. If users attempt to share a directory and work on versions from the same s-file at the same time, the get command will refuse to retrieve a version. Editing a Single Version A single version of a file can be edited by more than one user if the j flag is set in the sfile. The flag causes the get command to check the p-file and create a new proposed SID if the given version is already being edited. You can set the flag by using the -f option of the admin command. For example, the command admin -fj s.demo.c sets the flag for the s-file s.demo.c. When the flag is set, get uses the next available branch SID for each new proposed SID. For example, suppose a user retrieves for editing version 1.4 in the file s.demo.c and that the proposed version is 1.5. If a short time later (before the first user has saved his changes) another user retrieves version 1.4 for editing, then the proposed version for the new user will be 1.4.1.1, since version 1.5 is already proposed and likely to be taken. In no case will a version edited by two separate users result in a single new version. 5-21

SCCS: Source Code Control System XENIX Programming Saving a Specific Version When editing two or more versions of a file, you can direct the delta command to save a specific version by using the -r option to give the SID of that version. The command has the form delta -rSID s. filename where -rSID gives the SID of the version being saved and s.filename is the s-file to receive the new version. The SID may be the SID of the version you have just edited, or the proposed SID for the new version. For example, if you have retrieved version 1.4 for editing (and no version 1.5 exists), both commands and delta -r1.5 s.demo.c delta -r1.4 s.demo.c save version 1.5. Protecting s-files SCCS uses the normal XENIX system file permissions to protect s-files from changes by unauthorized users. In addition to the XENIX system protections, SCCS provides two of its own ways to protect the s-files: the user list and the protection flags. The user list is a list of login names and group IDs of users allowed to access the s-file and create new versions of the file. The protection flags are three special s-file flags that define which versions are currently accessible to otherwise authorized users. The following sections explain how to set and use the user list and protection flags. Adding a User to the User List You can add a user or a group of users to the user list of a given s-file by using the -a option of the ad min command. The option causes the given name to be added to the user list. The user list defines who may access and edit the versions in the s-file. The command has the form admin -aname s. filename where -aname gives the login name of the user or the group name of a group of users to be added to the list, and s.filename gives the name of the s-file to receive the new users. For example, the command admin -ajohnd -asuex -amarketing s.demo.c adds the users "johnd" and "suex" and the group "marketing" to the user list of the s-file s.demo.c. 5-22

SCCS: Source Code Control System <strong>XENIX</strong> Programming<br />

Saving a Specific Version<br />

When editing two or more versions of a file, you can direct the delta command to save a<br />

specific version by using the -r option to give the SID of that version. The command has<br />

the form<br />

delta -rSID s. filename<br />

where -rSID gives the SID of the version being saved and s.filename is the s-file to<br />

receive the new version. The SID may be the SID of the version you have just edited, or<br />

the proposed SID for the new version. For example, if you have retrieved version 1.4 for<br />

editing (and no version 1.5 exists), both commands<br />

and<br />

delta -r1.5 s.demo.c<br />

delta -r1.4 s.demo.c<br />

save version 1.5.<br />

Protecting s-files<br />

SCCS uses the normal <strong>XENIX</strong> system file permissions to protect s-files from changes by<br />

unauthorized users. In addition to the <strong>XENIX</strong> system protections, SCCS provides two of<br />

its own ways to protect the s-files: the user list and the protection flags. The user list<br />

is a list of login names and group IDs of users allowed to access the s-file and create<br />

new versions of the file. The protection flags are three special s-file flags that define<br />

which versions are currently accessible to otherwise authorized users. The following<br />

sections explain how to set and use the user list and protection flags.<br />

Adding a User to the User List<br />

You can add a user or a group of users to the user list of a given s-file by using the -a<br />

option of the ad min command. The option causes the given name to be added to the<br />

user list. The user list defines who may access and edit the versions in the s-file. The<br />

command has the form<br />

admin -aname s. filename<br />

where -aname gives the login name of the user or the group name of a group of users to<br />

be added to the list, and s.filename gives the name of the s-file to receive the new<br />

users. For example, the command<br />

admin -ajohnd -asuex -amarketing s.demo.c<br />

adds the users "johnd" and "suex" and the group "marketing" to the user list of the s-file<br />

s.demo.c.<br />

5-22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!