home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume22 / cvs3.0 / part01 next >
Text File  |  1990-06-07  |  62KB  |  2,303 lines

  1. Subject:  v22i013:  Concurrent RCS version system, release 3.0, Part01/02
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 7f58c124 a89d0391 efec2037 7a1892eb
  5.  
  6. Submitted-by: Dick Grune <dick@cs.vu.nl>
  7. Posting-number: Volume 22, Issue 13
  8. Archive-name: cvs3.0/part01
  9.  
  10. [ This is the basis for Brian Berliner's CVS presented at the last Usenix,
  11.   to appear tomorrow.  --r$  ]
  12.  
  13. CVS, published last in comp.sources.unix in "Volume 6 (Ends mid-July, 1986)",
  14. has evolved a bit, under user demand, hopefully without succumbing to
  15. creeping featurism. This is Release 3 (the previous published one was
  16. probably Release 1, acc. to present nomenclature).
  17.  
  18. CVS is a front end for RCS, supporting the concurrent and independent
  19. use of an RCS directory by several people.  See manual page cvs.1.
  20.  
  21. This set of shell scripts assumes the presence of the RCS programs
  22. rcs, ci, co, rcsmerge and rlog (by Walter Tichy).
  23.  
  24.  
  25.                 Kind regards,
  26.                     Dick Grune
  27.                     Vrije Universiteit
  28.                     de Boelelaan 1081
  29.                     1081 HV  Amsterdam
  30.                     the Netherlands
  31.                     dick@cs.vu.nl
  32.  
  33. ----------------------------------------------------------------
  34. : This is a shar archive.  Extract with sh, not csh.
  35. : This archive ends with exit, so do not worry about trailing junk.
  36. : --------------------------- cut here --------------------------
  37. PATH=/bin:/usr/bin:/usr/ucb
  38. echo Extracting 'READ_ME'
  39. sed 's/^X//' > 'READ_ME' << '+ END-OF-FILE ''READ_ME'
  40. X#    This file is part of the Concurrent Versions System CVS.
  41. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  42. X#    $Header: READ_ME,v 3.2 89/09/26 15:33:30 dick Exp $
  43. X
  44. XThis is Release 3, 890925.
  45. X
  46. XCVS is a front end for RCS, supporting the concurrent and independent
  47. Xuse of an RCS directory by several people.  See manual page cvs.1.
  48. X
  49. XThis set of shell scripts assumes the presence of the RCS programs
  50. Xrcs, ci, co, rcsmerge and rlog (by Walter Tichy).
  51. X
  52. XTo install, examine the Makefile and give suitable values to:
  53. X
  54. XCVSBIN    the directory for the commands themselves    eg. /usr/local/bin
  55. XCVSLIB    idem for the auxiliaries            eg. /usr/lib/local/cvs
  56. XCVSMAN    idem for the manual page cvs.1            eg. /usr/man/man1
  57. XRCSBIN    the directory that holds the RCS programs    eg. /usr/bin
  58. X
  59. XThen call     make install
  60. X
  61. XBe sure you can write/create:
  62. X    in $(CVSBIN): AE CM CV DF GC HR LS NR RC RM RV UV  REP LAR LAU LCK
  63. X    in $(CVSLIB): anything
  64. X    in $(CVSMAN): cvs.1
  65. X
  66. XHistorian:
  67. X    Unlike the previous releases this release keeps a configuration history
  68. X    file. To construct such a file retroactively a 'historian' has been
  69. X    added. See manual page historian.1. Install by calling
  70. X        make install.hist
  71. X    Be sure you can write/create:
  72. X        in $(CVSBIN): historian hist1 hist2 coALL
  73. X        in $(CVSMAN): historian.1
  74. X
  75. XChanges from release 880312 (configuration 1.93, should have been Release 2):
  76. X    features a series of commands to handle sets of repositories
  77. X    keeps a configuration history file
  78. X    release numbers can be set for a (set of) repositories
  79. X
  80. XChanges from release 860518 (configuration 1.61, should have been Release 1):
  81. X    preserves inodes when updating and committing
  82. X    DF has a better idea of what has changed
  83. X    maintains CVS.adm/Files containing all file names
  84. X    environment variables $RCSBIN and $CVSPATH, to access binaries
  85. X    Changed the name of the attic directory from .old to Attic.
  86. X
  87. X
  88. X                    Dick Grune
  89. X                    Vrije Universiteit
  90. X                    de Boelelaan 1081
  91. X                    1081 HV  Amsterdam
  92. X                    the Netherlands
  93. X                    dick@cs.vu.nl
  94. + END-OF-FILE READ_ME
  95. chmod 'u=rw,g=r,o=r' 'READ_ME'
  96. set `wc -c 'READ_ME'`
  97. count=$1
  98. case $count in
  99. 1973)    :;;
  100. *)    echo 'Bad character count in ''READ_ME' >&2
  101.         echo 'Count should be 1973' >&2
  102. esac
  103. echo Extracting 'Makefile'
  104. sed 's/^X//' > 'Makefile' << '+ END-OF-FILE ''Makefile'
  105. X#    This file is part of the Concurrent Versions System CVS.
  106. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  107. X#    $Header: Makefile,v 3.2 89/09/28 17:42:41 dick Exp $
  108. X
  109. XCVSBIN =    /home/top/dick/bin#    # where to install the CVS programs
  110. XCVSLIB =    /home/top/dick/lib/cvs#    # where to install the CVS auxiliaries
  111. XCVSMAN =    /home/top/dick/man#    # where to install the CVS manual
  112. XRCSBIN =    /usr/local/bin#        # where the RCS binaries reside
  113. X
  114. XINF =    READ_ME Makefile Install cvs.1 historian.1
  115. XPRG =    AE CM CV DF GC HR LS NR RC RM RV UV  REP LAR LAU LCK
  116. XAUX =    BE.aux CA.aux CC.aux CI.aux CS.aux EF.aux FN.aux HN.aux LR.aux MF.aux \
  117. X    ND.aux NR.aux OP.aux RG.aux SC.aux SL.aux VN.aux VT.aux WL.aux
  118. XHIST =    historian hist1 hist2 coALL
  119. X
  120. Xwhat:
  121. X    @echo "Call is: make [ install | install.hist | .distr | shar | clean ]"
  122. X
  123. Xinstall:    install.files $(CVSMAN)/cvs.1
  124. X
  125. Xinstall.files:
  126. X    for F in $(PRG); do ./Install $$F $(CVSBIN) $(CVSLIB) $(RCSBIN); done
  127. X    for F in $(AUX); do ./Install $$F $(CVSLIB) $(CVSLIB) $(RCSBIN); done
  128. X
  129. Xinstall.hist:
  130. X    for F in $(HIST); do ./Install $$F $(CVSBIN) $(CVSLIB) $(RCSBIN); done
  131. X    cp historian.1 $(CVSMAN)/historian.1
  132. X
  133. X$(CVSMAN)/cvs.1:    cvs.1
  134. X    cp cvs.1 $(CVSMAN)/cvs.1
  135. X
  136. X# create a (composite) shar file shar[12]
  137. Xshar:    shar1 shar2
  138. XSHAR1 =    $(INF) $(AUX) $(HIST)
  139. XSHAR2 =    $(PRG)
  140. X
  141. Xshar1:    $(SHAR1) Makefile
  142. X    shar $(SHAR1) >shar1
  143. X
  144. Xshar2:    $(SHAR2) Makefile
  145. X    shar $(SHAR2) >shar2
  146. X
  147. X.distr:    Makefile
  148. X    echo $(SHAR1) $(SHAR2) | tr ' ' '\012' >.distr
  149. X
  150. Xclean:
  151. X    rm -f shar[12] .distr
  152. X
  153. + END-OF-FILE Makefile
  154. chmod 'u=rw,g=r,o=r' 'Makefile'
  155. set `wc -c 'Makefile'`
  156. count=$1
  157. case $count in
  158. 1469)    :;;
  159. *)    echo 'Bad character count in ''Makefile' >&2
  160.         echo 'Count should be 1469' >&2
  161. esac
  162. echo Extracting 'cvs.1'
  163. sed 's/^X//' > 'cvs.1' << '+ END-OF-FILE ''cvs.1'
  164. X.\"    This file is part of the Concurrent Versions System CVS.
  165. X.\"    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  166. X.\"    $Header: cvs.1,v 3.3 89/10/06 12:58:22 dick Exp $
  167. X.TH CVS 1 89/09/25 "Vrije Universiteit"
  168. X.SH NAME
  169. Xcvs \- concurrent-versions system
  170. X.SH SYNOPSIS
  171. X.B CV
  172. Xrepository-name
  173. X.br
  174. X.B UV
  175. X[
  176. X.B \-n
  177. X] [ filename ... ]
  178. X.br
  179. X.B CM
  180. X[
  181. X.B \-n
  182. X] 'log-message' [ filename ... ]
  183. X.br
  184. X.B AE
  185. X[ \-... ] filename ...
  186. X.br
  187. X.B RM
  188. Xfilename ...
  189. X.br
  190. X.B LS
  191. X[ filename ... ]
  192. X.br
  193. X.B DF
  194. X[ \-... ] [ filename ... ]
  195. X.br
  196. X.B GC
  197. X.br
  198. X.B HR
  199. X[ repository-name ]
  200. X.br
  201. X.B NR
  202. Xrelease-number repository-name
  203. X.br
  204. X.B RC
  205. X[
  206. X.B \-i
  207. X] [ repository-name ]
  208. X.br
  209. X.B RV
  210. Xrepository-name configuration-identifier
  211. X.sp
  212. X.B REP
  213. X[
  214. X.B \-n
  215. X] CVS-command ...
  216. X.br
  217. X.B LAR
  218. Xdirectory
  219. X.br
  220. X.B LAU
  221. X.sp
  222. X.B LCK
  223. X[
  224. X.B on
  225. X|
  226. X.B off
  227. X]
  228. X.SH DESCRIPTION
  229. X.I CVS
  230. Xsupports the concurrent use of independent versions of an RCS directory or a
  231. Xset of RCS directories, and as such acts as a front end for RCS.  The user is
  232. Xnot required to know RCS commands or ever give them.  The original files of a
  233. Xproject reside in one or more RCS directories, called
  234. X.IR repositories ,
  235. Xand are handled by the above commands only.  The casual user uses
  236. X.I UV
  237. Xand
  238. X.I CM
  239. Xand may use
  240. X.IR CV ,
  241. X.IR DF
  242. Xand
  243. X.IR LS ;
  244. Xthe other commands are for maintenance only.
  245. X.PP
  246. XEach participant in the project has his own private copy of the
  247. Xfiles; such a copy is called a
  248. X.IR configuration .
  249. XEach participant can work on his copy at his convenience since it
  250. Xis totally his; the command
  251. X.I UV
  252. X(Update Version)
  253. Xwill merge updates to the repository into his files without
  254. Xdisturbing his own modifications; he can merge his own modifications back
  255. Xinto the repository with the command
  256. X.I CM
  257. X(commit).  Concurrency conflicts, which turn out to be rare anyway, are
  258. Xalmost always detected.  The repository is protected by multi-reader
  259. Xsingle-writer locks.  There is a simple facility for sets of user
  260. Xdirectories and repositories; see below.
  261. X.PP
  262. X.B "Commands"
  263. X.br
  264. X.B CV
  265. X(Create Version) creates a version of the configuration described by a
  266. Xrepository.  This configuration is owned totally by the user and is actually
  267. Xan independent copy, to be dealt with as seen fit.  Once
  268. X.I CV
  269. Xhas been called
  270. Xin a given directory, it never needs to be called again.  The
  271. Xuser can keep up-to-date by calling
  272. X.I UV
  273. Xwhen he feels like it;
  274. Xthis will supply him with a merge of his own modifications
  275. Xand the changes made by others in the repository.  See
  276. X.I UV
  277. Xfor details.
  278. X.PP
  279. XWhen the user is satisfied with his own modifications, the
  280. Xpresent configuration can be committed by
  281. X.I CM
  282. X(ComMit); this keeps the present configuration in tact.
  283. X.PP
  284. XThe call is
  285. X.br
  286. X    CV
  287. X.I repository-name
  288. X.br
  289. Xwith preferably the full path name of the repository.
  290. X.I CV
  291. Xwill then make the initial copy (at RCS speed).  Files in the
  292. Xworking directory with names that also occur in the repository are
  293. Xsupposed to derive already from the RCS files.
  294. X.PP
  295. X.I CV
  296. Xcreates a directory
  297. X.IR ./CVS.adm ,
  298. Xin which
  299. X.I CVS
  300. Xkeeps its
  301. Xadministration, in a number of files. Only the file
  302. X.I ./CVS.adm/Repository
  303. Xis of importance to the user, since it contains
  304. Xthe name of the repository.  This file is a normal file and can be
  305. Xedited by the user, if necessary (when the repository is moved, e.g.).
  306. X.PP
  307. X.B UV
  308. X(Update Version) updates the configuration in the present directory with
  309. Xrespect to the repository.  The present configuration must have been created
  310. Xby
  311. X.I CV.
  312. XThe call is
  313. X.br
  314. X    UV
  315. X.br
  316. Xfor a general update, or
  317. X.br
  318. X    UV
  319. X.I file ...
  320. X.br
  321. Xfor a partial update.
  322. X.PP
  323. XModified or new RCS files are checked out.
  324. XModified user files are reported on standard output
  325. Xas
  326. X.I "M\ user_file."
  327. XIf both the
  328. XRCS file and the user file have been modified, the user file
  329. Xis replaced by the result of
  330. X.I rcsmerge.
  331. XIf this throws up irreconcilable differences, the file is reported as
  332. X.I "C\ user_file,"
  333. Xand as
  334. X.I "M\ user_file"
  335. Xotherwise.
  336. XFiles added but not yet committed are reported as
  337. X.I "A\ user_file."
  338. XFiles removed but not yet decommitted are reported as
  339. X.I "R\ user_file."
  340. X.PP
  341. X.I UV
  342. Xallows a
  343. X.B \-n
  344. Xoption, which restricts the actions to reporting only.
  345. X.PP
  346. X.B CM
  347. X(ComMit) commits the present configuration to the repository,
  348. X.I after
  349. Xhaving done a test on conflicts.  The call is
  350. X.br
  351. X    CM
  352. X.I log-message
  353. X.br
  354. Xfor a general commit, and
  355. X.br
  356. X    CM
  357. X.I "log-message file ..."
  358. X.br
  359. Xfor a (dangerous!) partial commit.  The
  360. X.I log-message
  361. Xis obligatory, and will be passed to RCS to be stored in the affected
  362. Xrepository files.
  363. X.PP
  364. X.I CM
  365. Xallows a
  366. X.B \-n
  367. Xoption, which restricts the actions to reporting only.
  368. X.PP
  369. X.B AE
  370. X(Add Entries) adds new entries to the present configuration; for each file it
  371. Xasks for a description, in RCS fashion.
  372. XThe entries will be added to the repository upon the next call of
  373. X.I CM.
  374. XThe user files must already exist.
  375. X.I AE
  376. Xon a file removed with
  377. X.I RM
  378. Xwill resurrect the file, unless its removal has already been committed.
  379. XAny options to
  380. X.I AE
  381. Xwill be passed on to
  382. X.I rcs \-i
  383. X(see RCS manual).
  384. X.PP
  385. X.B RM
  386. X(ReMove) marks the entries as removed on purpose from the present
  387. Xconfiguration.  The RCS files will be actually removed from the repository
  388. Xupon the next call of
  389. X.I CM;
  390. Xthey will be moved to a directory
  391. X.I Attic
  392. Xin the repository.
  393. X.PP
  394. X.B LS
  395. Xprints three lines of information for each of its arguments,
  396. Xone for the user file (line 1), one for the newest RCS file
  397. X(line 3) and one for the RCS file both derive from (line 2).
  398. XLike the Unix
  399. X.I ls,
  400. Xit will treat all files if no arguments are given.
  401. X.PP
  402. X.B DF
  403. Xdoes a nice form of diff(1) on each of its arguments and the
  404. XRCS file that argument derives from.
  405. XIf there are options, these are passed to diff(1) and the diff
  406. Xformat is adhered to; otherwise a more readable format is produced.
  407. XStandard diff(1) format can also be forced by a single \-.
  408. XIf there are no file names,
  409. X.I DF
  410. Xtreats the files that have been modified since the last call to
  411. X.I CM.
  412. XIf the option is
  413. X.B \-n,
  414. Xdiff(1) will not be called, but the list of modified files will be displayed
  415. Xinstead.
  416. X.PP
  417. X.B GC
  418. X(Garbage Collection) collects garbage, dust & dead wood.  Should be called
  419. Xafter crashes while a
  420. X.IR CVS -program
  421. Xwas running, and other mishaps.
  422. XIt is up to the user to remove (or not!) the files
  423. X.I GC
  424. Xcomplains about.
  425. X.PP
  426. X.B HR
  427. X(Highest Release number) writes the highest release number of any RCS file in
  428. Xthe repository to standard output. If no argument is given, the command
  429. Xapplies to the repository of which the working directory derives. The "release
  430. Xnumber" is the first part of the RCS revision number.
  431. X.PP
  432. X.B NR
  433. X(New Release number) sets the (highest) release number of a repository to the
  434. Xnumber which is its first argument. The repository should have been locked by
  435. X.I "LCK on"
  436. Xalready. The number must be higher than the present release number.
  437. X.PP
  438. X.B "Examining and restoring previous versions"
  439. X.br
  440. X.I CVS
  441. Xkeeps a history of the versions of the configurations that have been
  442. Xcommitted to the repository.
  443. X.PP
  444. X.B RC
  445. X(Retrieve Configuration history) displays the configuration identifier,
  446. Xdate and log message of each version.  A configuration is represented by a
  447. X.IR "configuration identifier" ,
  448. Xwhich is basically the version number of a record describing the contents of
  449. Xthe configuration.  This configuration identifier can be presented to
  450. X.I RV,
  451. Xwhich will restore the identified configuration; this process
  452. Xrequires the repository again (or still) to be present, though not
  453. Xnecessarily with the same path name.
  454. X.br
  455. X    RC \-i
  456. X.br
  457. Xwill print the configuration identifier of the present configuration.
  458. X.I RC
  459. Xcan be given the name of a repository as a parameter, and will then work on
  460. Xthat repository.
  461. X.PP
  462. XOlder versions of CVS (before Release 3) did not keep this configuration
  463. Xhistory; it can be reconstructed for old repositories by using the program
  464. X.I historian ;
  465. Xsee historian(1).
  466. X.PP
  467. X.B RV
  468. X(Restore Version) restores a version of the configuration, given the
  469. Xrepository name and a configuration identifier.  The call is
  470. X.br
  471. X    RV
  472. X.I "repository-name configuration-identifier"
  473. X.br
  474. XThe repository has to exist; the files will be reconstructed with the correct
  475. Xrevision number, even if they were removed by
  476. X.I RM
  477. Xand
  478. X.I CM
  479. Xin the meantime.
  480. X.PP
  481. XFor backward compatibility,
  482. X.I RV
  483. Xwill still be able to work from SV-records, as created by the late program
  484. XSV. The SV-record will be read from standard input by the call
  485. X.B RV
  486. X.I "repository-name"
  487. X.B \-
  488. X.PP
  489. XIf the configuration identifier is kept of the distribution sent to a client,
  490. Xthe following scenario is useful when the client sends in some
  491. Xcorrections.  In an empty directory, call
  492. X.I "RV conf-idf"
  493. Xto reconstruct the client's files.  Apply his corrections.  Call
  494. X.I UV
  495. Xto integrate them with your own innovations.  Call
  496. X.I DF
  497. Xand test, to see if they still make sense.  If satisfied, call
  498. X.I CM
  499. Xand remove the directory.
  500. X.PP
  501. X.B "Sets of directories"
  502. X.br
  503. XProjects are often not confined to a single repository, nor to a single user
  504. Xdirectory, and having CVS commands that work on sets of both would be useful.
  505. XThere is, however, no generally accepted tree structure for RCS directories
  506. Xwith subdirectories, so the user is required to specify their structure and the
  507. Xrelated user directory structure. This information, which includes a list of
  508. Xdirectories or repositories, is fed (on standard input)
  509. Xto
  510. X.B REP
  511. X(for Repeat) which is given the CVS command to be repeated as its first
  512. Xargument. A second reason for this factorized approach is that CVS commands on
  513. Xsets of repositories can take hours, may come to an abnormal end, and may have
  514. Xto be restarted somewhere in the middle. The latter can be achieved by
  515. Xsupplying the remainder of the input list to a second call of
  516. X.I REP.
  517. X.PP
  518. X.I REP
  519. Xis not naive about the command under its control and knows that different
  520. Xcommands require different arguments; depending on its command
  521. X.I REP
  522. Xitself will require different input and further arguments. Several types of
  523. Xcalls can be distinguished.
  524. X.LP
  525. X    <UserDir-list REP UV
  526. X.br
  527. X    <UserDir-list REP CM 'message'
  528. X.br
  529. X    <UserDir-list REP LS
  530. X.br
  531. X    <UserDir-list REP DF
  532. X.br
  533. X    <UserDir-list REP GC
  534. X.br
  535. XThe commands require a list of user directory names as input, and will
  536. Xperform the named command in all these directories.
  537. X.LP
  538. X    <Repository-list REP RC [ \-i ]
  539. X.br
  540. X    <Repository-list REP HR
  541. X.br
  542. X    <Repository-list REP NR release-number
  543. X.br
  544. XThe commands require a list of repository names as input.
  545. X.I "REP RC"
  546. Xgives a formatted report of the configuration histories and
  547. X.I "REP RC \-i"
  548. Xproduces output of the form
  549. X.br
  550. X    <repository-name> <configuration-identifier>
  551. X.br
  552. Xwhich can serve as a basis for input to a later call of
  553. X.IR "REP RV" .
  554. X.I "REP HR"
  555. Xgives the over-all highest release number in the repository tree.
  556. X.I "REP NR release-number"
  557. Xsets the over-all highest release number in the repository tree to
  558. X.I release-number.
  559. X.LP
  560. X    <Repository-UserDir-list REP CV
  561. X.br
  562. XThe command requires a list of repository-name/user-directory-name pairs
  563. X(separated by a space) as input, and will create the described versions,
  564. Xcreating user directories if necessary. 
  565. X.LP
  566. X    <Repository-UserDir-ConfIdf-list REP RV
  567. X.br
  568. XThe command requires a list of
  569. Xrepository-name/user-directory-name/configuration-identifier triplets
  570. X(separated by spaces) as input, and will restore the described versions,
  571. Xcreating user directories if necessary.
  572. X.PP
  573. XThe CVS commands
  574. X.I AE
  575. Xand
  576. X.I RM
  577. Xcannot be repeated.
  578. X.I REP
  579. Xitself can have a
  580. X.B \-n
  581. Xoption, which causes it to print its commands rather than execute them.
  582. X.PP
  583. XThe input to
  584. X.I REP
  585. Xcan be obtained in various ways. The user (project manager) can keep files that
  586. Xembody the proper interrelationships; if the relations are irregular, that may
  587. Xbe the only way. UserDir lists can be generated by
  588. X.B LAU
  589. X(List All User directories), which lists all user directories under CVS that
  590. Xare subdirectories of the working directory, according to the criterion that
  591. Xa user directory under CVS contains a directory
  592. X.IR CVS.adm .
  593. XConsequently,
  594. X.br
  595. X    LAU | REP UV
  596. X.br
  597. Xwill do an update on the working directory and all its CVS subdirectories.
  598. XRepository-lists can be generated by a call of
  599. X.B LAR
  600. X(List All Repositories).
  601. X.I "LAR directory"
  602. Xlists all repositories that are subdirectories of
  603. X.IR directory ,
  604. Xaccording to the criterion that a repository contains RCS files and that it
  605. Xis not named
  606. X.I Attic
  607. Xor
  608. X.IR Admin .
  609. XConsequently,
  610. X.br
  611. X    LAR <top-repository> | REP HR
  612. X.br
  613. Xwill display the over-all highest release number in the whole repository tree.
  614. XMore complex input lists (for
  615. X.I CV
  616. Xand
  617. X.IR RV )
  618. Xwill have to be constructed by additional means. If the user tree is to have
  619. Xthe same form as the repository tree, the following
  620. X.IR sed (I)
  621. Xcommand may be useful:
  622. X.DS
  623. X.cw
  624. Xsed '
  625. X    s/.*/&|&/
  626. X    s|'"$RCSPREFIX"'|'"$USERPREFIX"'|
  627. X    s/\e(.*\e)|\e(.*\e)/\e2\ \e1/
  628. X\&'
  629. X.ft 0
  630. X.DE
  631. Xwhich converts, e.g.
  632. X.br
  633. X    /home/x8/RCS/part3/module5
  634. X.br
  635. Xinto
  636. X.br
  637. X    /home/x8/RCS/part3/module5 /usr/x8/part3/module5
  638. X.br
  639. Xwith the setting RCSPREFIX=/home/x8/RCS and USERPREFIX=/usr/x8, thus creating
  640. Xinput to
  641. X.IR "REP CV" .
  642. X.PP
  643. X.B LCK
  644. Xcan be used to manually lock (first argument
  645. X.BR on )
  646. Xand unlock (first argument
  647. X.BR off )
  648. Xa repository. Although this command can be used on separate repositories, it
  649. Xis normally used on a set (tree) of them, which is why it is treated here. It
  650. Xshould
  651. X.I not
  652. Xbe used by the normal user;
  653. X.I CM
  654. Xand
  655. X.I UV
  656. Xhandle all normal cases. The command is required before doing
  657. X.IR NR ,
  658. Xand is useful to ensure that no activity takes place in a repository.
  659. X.PP
  660. X.B "Setting up"
  661. X.br
  662. XTo set up a repository
  663. X.I repos,
  664. Xmake an empty directory of that name, call
  665. X.I "CV repos,"
  666. Xdo
  667. X.I AE
  668. Xfor each file to go into the repository and finally call
  669. X.I CM
  670. Xto commit the initial version.
  671. X.PP
  672. XTo participate in an existing repository
  673. X.I repos,
  674. Xi.e., to create your own private configuration of a repository, just call
  675. X.I "CV repos".
  676. X.PP
  677. XTo turn an existing RCS directory into a repository, you can likewise call
  678. X.I "CV repos",
  679. Xsince no administration is kept in the RCS directory.
  680. XThis works even if both the user files and
  681. Xthe RCS directory already exist (this is useful if you want to start using
  682. X.I CVS
  683. Xfor an existing project).
  684. X.PP
  685. X.B "Remarks"
  686. X.br
  687. XIt is generally not wise to interrupt a CVS command: many of them perform a
  688. Xlarge number of actions that are only meaningful if done in their entirety or
  689. Xnot at all, and UNIX is not good at pretending it's all one indivisible
  690. Xaction. If a CVS command has succumbed to a system crash, act as follows.
  691. XCall
  692. X.I GC
  693. Xrepeatedly and act on its messages until it shuts up.  You can
  694. Xunlock an RCS file that may have been left locked by calling
  695. X.I "rcs -u",
  696. Xand unlock a repository by calling
  697. X.I "LCK off repos".
  698. XThen call
  699. X.I UV
  700. Xand act on its messages until it shuts up.  And then call
  701. X.I UV
  702. Xagain (this is necessary to get the time stamps right in some cases).
  703. X.PP
  704. XIf the user configuration is quiescent (i.e.,
  705. X.I "DF \-n"
  706. Xgives no output), the user can remove his files with impunity; a
  707. Xsubsequent call of
  708. X.I UV
  709. Xwill restore the full configuration.
  710. X.SH "ENVIRONMENT VARIABLES"
  711. X.IP RCSBIN 8
  712. XIf defined: the name of the directory where the RCS programs reside.
  713. XDefault: as determined in the
  714. X.I Makefile.
  715. X.IP CVSPATH 8
  716. XIf defined: the search path for non-RCS programs.  Default:
  717. X.I /bin:/usr/bin.
  718. X.SH FILES
  719. X.ta 8n 36n
  720. XIn the present directory:
  721. X.br
  722. X    *,[pt]    options and text from
  723. X.I AE
  724. X.br
  725. XIn the directory ./CVS.adm:
  726. X.br
  727. X    Repository    holds name of repository
  728. X.br
  729. X    Files    list of file names in the configuration
  730. X.br
  731. X    Entries    version number and time stamp for each file
  732. X.br
  733. X    Entries.Backup
  734. X.br
  735. X    Mod    names of files modified since last
  736. X.I CM
  737. X(or since
  738. X.IR CV )
  739. X.br
  740. X    LastUpdate    time stamp of latest full update
  741. X.br
  742. XIn the repository:
  743. X.br
  744. X    Attic/    attic for removed files
  745. X.br
  746. X    #cvs.*    multi-reader single-writer locks
  747. X.br
  748. X    Admin/    holds
  749. X.I CVS.confrec,v
  750. Xfor the configuration history
  751. X.br
  752. X        and
  753. X.I HighestRelease
  754. Xfor the highest release number
  755. X.br
  756. XElsewhere:
  757. X.br
  758. X    rcs, ci, co, rcsmerge, rlog    RCS programs
  759. X.SH SEE ALSO
  760. Xhistorian(1); RCS documentation, rcsintro(1)
  761. X.SH AUTHOR
  762. XDick Grune, Vrije Universiteit, Amsterdam
  763. X.SH DIAGNOSTICS
  764. XBoth
  765. X.I UV
  766. Xand
  767. X.I CM
  768. Xattempt first to make sure that all required actions are possible before
  769. Xdoing any of them.
  770. X.SH DISADVANTAGES
  771. XIf
  772. X.I N
  773. Xusers participate, there will be
  774. X.I N
  775. Xcopies on disk.
  776. X.br
  777. XIt's all shell files and slow.
  778. X.br
  779. X.SH BUGS
  780. XThere is not (yet) a way to work with branches.
  781. X.br
  782. XFunny file names (e.g. containing spaces or *) will give trouble.
  783. X.br
  784. XWeird things happen if the RCS programs cannot be found.
  785. X.br
  786. XDo not run two of the
  787. X.I CVS
  788. Xprograms simultaneously in the same user
  789. Xdirectory; there is no lock-out on the user directory, for
  790. Xefficiency reasons (though there is on the repository).
  791. + END-OF-FILE cvs.1
  792. chmod 'u=rw,g=r,o=r' 'cvs.1'
  793. set `wc -c 'cvs.1'`
  794. count=$1
  795. case $count in
  796. 16569)    :;;
  797. *)    echo 'Bad character count in ''cvs.1' >&2
  798.         echo 'Count should be 16569' >&2
  799. esac
  800. echo Extracting 'historian.1'
  801. sed 's/^X//' > 'historian.1' << '+ END-OF-FILE ''historian.1'
  802. X.\"    This file is part of the Concurrent Versions System CVS.
  803. X.\"    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  804. X.\"    $Header: historian.1,v 3.2 89/10/02 15:15:21 dick Exp $
  805. X.TH HISTORIAN 1 89/09/25
  806. X.SH NAME
  807. Xhistorian \- reconstruct configuration history for CVS
  808. X.SH SYNOPSIS
  809. X.B historian
  810. X[ repository ]
  811. X.br
  812. X.B hist1
  813. X[ repository ]
  814. X>ph1
  815. X.br
  816. X.B hist2
  817. X[ repository ]
  818. X<ph1 >ph2
  819. X.br
  820. X.B coALL
  821. Xfilename
  822. X.SH DESCRIPTION
  823. XRelease 3 of CVS keeps the history of the project in an RCS file
  824. X.IR $Repository/Admin/CVS.confrec,v ,
  825. Xwhich holds the revisions of the
  826. X.I "configuration record,"
  827. Xwhich in its turn is a file with the names of the files that make up the
  828. Xconfiguration, with their version numbers. If you start using CVS on a new
  829. Xrepository, CVS will create such a configuration history file for you
  830. Xand maintain it. If, however, you use the new CVS on an old
  831. Xrepository, then CVS, not knowing any better, will also create this
  832. Xconfiguration history file, and subsequent calls to RC will suggest that the
  833. Xrepository originated at the time you started using the new CVS: your previous
  834. Xconfiguration history is lost. This may or may not bother you. If it does
  835. Xnot, there is no problem; everything will work normally, except that older
  836. Xconfigurations cannot be retrieved by configuration identifier using
  837. X.I RV
  838. X(they can still be retrieved manually or by using old output of SV).
  839. X.PP
  840. X.I "Reconstruction, ignoring removed files"
  841. X.PP
  842. XThe program
  843. X.I historian
  844. Xcan help you to recreate (or more precisely: to create) the configuration
  845. Xhistory of the entire repository from the moment it was first brought
  846. Xunder RCS (not: CVS!). It can be called with or without a parameter; it will
  847. Xthen reconstruct the configuration history file for the repository belonging
  848. Xto the working directory, or for the repository given as a parameter. This
  849. Xwill take a couple of minutes and the result can be enjoyed by calling
  850. X.I "RC."
  851. X.PP
  852. XThe resulting configuration history file will be correct if no files have
  853. Xever been removed from the indicated configuration.
  854. XIf files have been removed from the configuration (using
  855. X.IR RM ),
  856. Xthen there is a minor but serious problem: the historian cannot find out
  857. Xexactly when a file was removed from the configuration; it will tell you so 
  858. Xbut it will nevertheless construct a configuration history file. Files which
  859. Xare removed are moved to
  860. X.IR $Repository/Attic ,
  861. Xbut their arrival there was not recorded anywhere and their last modification
  862. Xtime is not a good indication either. So, to get this right, the historian
  863. Xneeds help from a human.
  864. X.PP
  865. XThere are two things you can do about this. One is to do nothing; the result is
  866. Xthat some old configurations, as retrieved by
  867. X.I RV,
  868. Xwill contain files
  869. Xthat should not have been there. However, the history of all configurations
  870. Xcreated after the first CM from CVS Release 3 will be correct and will not
  871. Xshow any obsolete files any more. If this is acceptable, doing
  872. Xnothing about the removed files is by far the easiest option.
  873. X.PP
  874. X.I "Reconstruction, considering removed files"
  875. X.PP
  876. XIt is possible to tell the historian exactly when a file was removed. To
  877. Xunderstand the method, we have to take a closer look at what the historian
  878. Xdoes. It consists of three phases, executed by
  879. X.I hist1,
  880. X.I hist2
  881. Xand
  882. X.I sh,
  883. Xrespectively.
  884. X.PP
  885. X.I Hist1
  886. Xdoes a call of the RCS program
  887. X.I rlog
  888. Xon all the files in the repository and the Attic, and combines the output into
  889. Xa list of changes at each commit. For each commit that the historian is able
  890. Xto discern, it writes a group of lines, each line identifying time, file
  891. Xname, RCS version number, author and message of a single file. This group
  892. Xdescribes the forward
  893. X.I delta
  894. Xeffected by the identified commit and is terminated by a blank line, which is
  895. Xessential to the functioning of
  896. X.I hist2.
  897. X.PP
  898. X.I Hist2
  899. Xreads this list from standard input and constructs from it a shell script that
  900. Xwill construct the configuration history file in a sequence of calls to the RCS
  901. Xprogram
  902. X.I ci
  903. Xand to the UNIX editor
  904. X.I ed.
  905. XThe contents of this script can only be described as "gross".
  906. X.PP
  907. XThis script is then fed to the UNIX shell
  908. X.I sh.
  909. XSo, the following pipe line will construct the configuration history file:
  910. X.br
  911. X.B "    hist1 | hist2 | sh"
  912. X.br
  913. X.PP
  914. XThis is indeed the main contents of the program
  915. X.I historian.
  916. X.PP
  917. XThe input to
  918. X.I hist2
  919. Xnormally consists of the list of commit deltas, where each line in a commit
  920. Xdelta consists of many fields. If a line in a commit delta contains one field
  921. Xonly, it is taken by
  922. X.I hist2
  923. Xto be the name of a file which was removed during the commit of that
  924. Xdelta. So, by editing the output of
  925. X.I hist1
  926. Xand adding file names in the proper places, the user can tell
  927. X.I hist2
  928. Xwhen files were removed; be sure not to add or remove blank lines
  929. Xduring this edit operation, especially not the one at the end of the file.
  930. XThe need to manually edit the information stream at some point is the main
  931. Xreason why the historian's process was divided into two parts.
  932. X.PP
  933. XThe problem is that it is very difficult for the user to find out during which
  934. Xcommit the file was removed. The following approach may be useful.
  935. X.PP
  936. XWhen a file is used in a configuration, it is likely to be mentioned in the
  937. XMakefile. The historian's aid
  938. X.I coALL
  939. Xcan be used to retrieve all versions of, e.g., the Makefile. A call
  940. X.br
  941. X.B "    coALL Makefile"
  942. X.br
  943. Xcreates a directory
  944. X.I Makefile.ALL
  945. Xand stores in it all versions of the Makefile, each identified by its RCS
  946. Xversion number. By using the UNIX command
  947. X.I grep
  948. Xon these files, it is often easy to determine in which versions of the
  949. XMakefile a given file was used. This gives the highest version number in
  950. Xwhich it was used, and consequently, the version number of the first Makefile
  951. Xthat no longer uses it. The commit delta in the input of
  952. X.I hist2
  953. Xthat enters this version of the Makefile should contain the remove message for
  954. Xthe file being examined.
  955. X(coALL will also work on other file names).
  956. X.PP
  957. XThe process of identifying a file in a configuration by inspecting e.g., a
  958. XMakefile is so problem-dependent that I think it is not worth while to
  959. Xautomate it. A file
  960. X.I read.c
  961. Xmay for instance occur as
  962. X.I read.o
  963. Xin the Makefile.
  964. X.PP
  965. XThe commands
  966. X.I hist1
  967. Xand
  968. X.I hist2
  969. Xdo not affect any files and can be run as often as desired, irrespective of the
  970. Xpresence of a configuration history file. The resulting shell script will only
  971. Xrun if there is no configuration history file already; it will only affect
  972. X.IR $Repository/Admin/CVS.confrec,v .
  973. XIf this file is removed, the script can be run as often as desired (i.e.
  974. Xuntil it does what you want).
  975. X.SH FILES
  976. Xhist1
  977. X.br
  978. Xhist2
  979. X.br
  980. XcoALL
  981. X.SH SEE ALSO
  982. Xcvs.1
  983. X.SH AUTHOR
  984. Xdick@cs.vu.nl (Dick Grune @ Vrije Universiteit, Amsterdam)
  985. X.SH DIAGNOSTICS
  986. XThe scripts take some liberty with the RCS commands, which sometimes give
  987. Xwarnings or error messages; these can be mostly ignored. Error messages from
  988. Xthe historian's commands are always identified as such.
  989. X.SH CAVEATS
  990. XThis is not production-quality software; be sure to check its effects.
  991. X.br
  992. XThe resulting shell script thinks it knows the internal structure of RCS
  993. Xfiles and modifies them under evasion of the normal interface.
  994. X.SH BUGS
  995. XThe first part of the historian relies on two consecutive commits never
  996. Xhaving the same message; if they have, they will coalesce.
  997. + END-OF-FILE historian.1
  998. chmod 'u=rw,g=r,o=r' 'historian.1'
  999. set `wc -c 'historian.1'`
  1000. count=$1
  1001. case $count in
  1002. 7288)    :;;
  1003. *)    echo 'Bad character count in ''historian.1' >&2
  1004.         echo 'Count should be 7288' >&2
  1005. esac
  1006. echo Extracting 'BE.aux'
  1007. sed 's/^X//' > 'BE.aux' << '+ END-OF-FILE ''BE.aux'
  1008. X#    This file is part of the Concurrent Versions System CVS.
  1009. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1010. X#    $Header: BE.aux,v 3.1 89/09/25 16:29:18 dick Exp $
  1011. X
  1012. X#
  1013. X#        B u i l d   E n t r y
  1014. X#    Script, to be included.
  1015. X#
  1016. X#    Assumes set:
  1017. X#        $CVSLIB
  1018. X#        $Name
  1019. X#        $Options
  1020. X#        $Rcs
  1021. X#        $Repository
  1022. X#        $User
  1023. X#
  1024. X#    Builds an entry for a new file and sets up $User,[pt] by
  1025. X#    interrogating the user.
  1026. X#
  1027. X#    Sets OK to no and calls continue, if necessary.
  1028. X#
  1029. X
  1030. X# there may be an old file with the same name in the attic!
  1031. X# this is an awkward place to test, but other places are equally awkward
  1032. Xif    # it is in the attic already
  1033. X    [ -r $Repository/Attic/$User,v ]
  1034. Xthen
  1035. X    echo $Name: there is an old file $User already \
  1036. X                        in $Repository/Attic >&2
  1037. X    OK=no
  1038. X    continue
  1039. Xfi
  1040. X
  1041. X# isn't the name too long?
  1042. Xif    # both $User and $User,x can be linked made by linking
  1043. X    ln $User $User, >/dev/null 2>/dev/null \
  1044. X&&
  1045. X    ln $User $User,x >/dev/null 2>/dev/null
  1046. Xthen
  1047. X    rm $User, $User,x
  1048. Xelse
  1049. X    rm -f $User,
  1050. X    echo $Name: filename $User is too long >&2
  1051. X    OK=no
  1052. X    continue
  1053. Xfi
  1054. X
  1055. X# store the options
  1056. Xecho "$Options" >$User,p
  1057. X
  1058. X# get a description file by imitating a call of rcs -i
  1059. Xecho "RCS file: $Rcs"
  1060. Xecho "enter description, terminated with ^D or '.':"
  1061. Xecho "NOTE: This is NOT the log message!"
  1062. Xcp /dev/null $User,t
  1063. Xwhile    # the user still provides text
  1064. X    read TXT
  1065. Xdo    # add it to $User,t, except if it is a single dot
  1066. X    if    # it is the terminating dot
  1067. X        [ "$TXT" = "." ]
  1068. X    then
  1069. X        break
  1070. X    fi
  1071. X    echo "$TXT" >>$User,t
  1072. Xdone
  1073. Xecho done
  1074. X
  1075. X# create the entry (at the end, since the user may have interrupted)
  1076. X$CVSLIB/RG.aux $User 0 "Initial $User"
  1077. + END-OF-FILE BE.aux
  1078. chmod 'u=rwx,g=rx,o=rx' 'BE.aux'
  1079. set `wc -c 'BE.aux'`
  1080. count=$1
  1081. case $count in
  1082. 1585)    :;;
  1083. *)    echo 'Bad character count in ''BE.aux' >&2
  1084.         echo 'Count should be 1585' >&2
  1085. esac
  1086. echo Extracting 'CA.aux'
  1087. sed 's/^X//' > 'CA.aux' << '+ END-OF-FILE ''CA.aux'
  1088. X#    This file is part of the Concurrent Versions System CVS.
  1089. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1090. X#    $Header: CA.aux,v 3.1 89/09/25 16:29:27 dick Exp $
  1091. X
  1092. X#
  1093. X#        C r e a t e   A d m i n i s t r a t i o n
  1094. X#    Script, to be included.
  1095. X#
  1096. X#    Assumes set:
  1097. X#        $Name
  1098. X#        $Repository
  1099. X#
  1100. X#    Creates a user CVS administration directory based on repository
  1101. X#    $Repository.
  1102. X#
  1103. X
  1104. X# install CVS.adm directory
  1105. Xif    # there is already a directory CVS.adm
  1106. X    [ -d CVS.adm ]
  1107. Xthen
  1108. X    echo $Name: this directory is already managed by CVS >&2
  1109. X    exit 1
  1110. Xfi
  1111. X
  1112. Xif    # we can create the administration directory
  1113. X    mkdir CVS.adm
  1114. Xthen    :
  1115. Xelse
  1116. X    echo $Name: cannot make administration directory ./CVS.adm >&2
  1117. X    exit 1
  1118. Xfi
  1119. X
  1120. X# set up the administration
  1121. Xecho $Repository >CVS.adm/Repository
  1122. Xcat /dev/null >CVS.adm/Entries
  1123. + END-OF-FILE CA.aux
  1124. chmod 'u=rw,g=r,o=r' 'CA.aux'
  1125. set `wc -c 'CA.aux'`
  1126. count=$1
  1127. case $count in
  1128. 777)    :;;
  1129. *)    echo 'Bad character count in ''CA.aux' >&2
  1130.         echo 'Count should be 777' >&2
  1131. esac
  1132. echo Extracting 'CC.aux'
  1133. sed 's/^X//' > 'CC.aux' << '+ END-OF-FILE ''CC.aux'
  1134. X#    This file is part of the Concurrent Versions System CVS.
  1135. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1136. X#    $Header: CC.aux,v 3.2 89/10/13 12:04:18 dick Exp $
  1137. X
  1138. X#
  1139. X#        C o m m i t  C o n f i g u r a t i o n   f i l e
  1140. X#    Script, to be included.
  1141. X#
  1142. X#    Assumes set:
  1143. X#        $Name
  1144. X#        $ACT
  1145. X#        $Repository
  1146. X#        $Message
  1147. X#        $RCSBIN
  1148. X#        $RcsCfr
  1149. X#        $UsrCfr
  1150. X#        $Revision        # -r<number> or empty
  1151. X#
  1152. X#    Commits the new version of the configuration history file, $UsrCfr
  1153. X#
  1154. X
  1155. X# we need the configuration history file
  1156. Xif    # there is a configuration history file
  1157. X    [ -r $RcsCfr ]
  1158. Xthen    :
  1159. Xelse    # try to create it
  1160. X    if    echo "Configuration history file handled automatically by CVS" |
  1161. X        $ACT $RCSBIN/rcs -i $RcsCfr
  1162. X    then    :
  1163. X    else    echo $Name on $Repository: could not create \
  1164. X            automatic configuration history file >&2
  1165. X        exit 1
  1166. X    fi
  1167. Xfi
  1168. X
  1169. X# check it in
  1170. Xif    # lock the RCS file
  1171. X    $ACT $RCSBIN/rcs -q -l $RcsCfr 2>&1
  1172. Xthen    :
  1173. Xelse    # something went wrong
  1174. X    echo $Name on $Repository: could not lock \
  1175. X        configuration history file >&2
  1176. X    rm $UsrCfr
  1177. X    exit 1
  1178. Xfi
  1179. X
  1180. Xif    # check in the configuration record
  1181. X    $ACT $RCSBIN/ci $Revision -m"$Message" -f $RcsCfr $UsrCfr 2>&1
  1182. Xthen    # the file $UsrCfr will now be gone
  1183. X    :
  1184. Xelse    # something is wrong; unlock the locked file & remove the added file
  1185. X    echo $Name on $Repository: automatic configuration history file \
  1186. X            not updated >&2
  1187. X    if    # unlock $RcsCfr
  1188. X        $ACT $RCSBIN/rcs -q -u $RcsCfr
  1189. X    then    :
  1190. X    else    # something very wrong
  1191. X        echo $Name: HELP: could not UNlock $RcsCfr >&2
  1192. X    fi
  1193. X
  1194. X    rm -f $UsrCfr
  1195. X
  1196. X    # and give up
  1197. X    exit 1
  1198. Xfi
  1199. X
  1200. + END-OF-FILE CC.aux
  1201. chmod 'u=rw,g=r,o=r' 'CC.aux'
  1202. set `wc -c 'CC.aux'`
  1203. count=$1
  1204. case $count in
  1205. 1510)    :;;
  1206. *)    echo 'Bad character count in ''CC.aux' >&2
  1207.         echo 'Count should be 1510' >&2
  1208. esac
  1209. echo Extracting 'CI.aux'
  1210. sed 's/^X//' > 'CI.aux' << '+ END-OF-FILE ''CI.aux'
  1211. X#    This file is part of the Concurrent Versions System CVS.
  1212. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1213. X#    $Header: CI.aux,v 3.1 89/09/25 16:29:46 dick Exp $
  1214. X
  1215. X#
  1216. X#        C h e c k   I n
  1217. X#    Script, to be included
  1218. X#
  1219. X#    Assumes set:
  1220. X#        $ACT
  1221. X#        $CVSLIB
  1222. X#        $Message
  1223. X#        $Name
  1224. X#        $RCSBIN
  1225. X#        $Repository
  1226. X#        $User
  1227. X#
  1228. X#    Does a very careful check-in of the file $User, and tries not
  1229. X#    to spoil its modification time (to avoid useless recompilations)
  1230. X#
  1231. X#    Sets OK to no, if necessary.
  1232. X#
  1233. X
  1234. Xecho Checking in $User\; log: "$Message"
  1235. XRcs=$Repository/$User,v
  1236. X
  1237. X# offer a copy of $User to RCS/ci, to preserve the inode
  1238. XOrig=,,$User
  1239. X$ACT mv $User $Orig
  1240. X$ACT cp $Orig $User
  1241. X
  1242. Xif    # check in $Rcs
  1243. X    $ACT $RCSBIN/ci -m"$Message" $Rcs 2>&1
  1244. Xthen    # the file $User will now be gone;
  1245. X    # get a new $User, with a possibly updated $Header
  1246. X    if    # check out $Rcs into $User, creating a new inode
  1247. X        $ACT $RCSBIN/co -q $Rcs
  1248. X    then    # restore $Orig from it with as few modifications as possible
  1249. X        if    # there were no modifications made by $RCSBIN/co
  1250. X            $ACT cmp -s $User $Orig
  1251. X        then    :
  1252. X        else    # we must copy these modifications to $Orig
  1253. X            $ACT cp $User $Orig
  1254. X        fi
  1255. X        # undo the whole renaming
  1256. X        $ACT rm -f $User
  1257. X        $ACT mv $Orig $User
  1258. X    else    # something is wrong but we have still got $Orig
  1259. X        $ACT mv $Orig $User
  1260. X        echo $Name: could not check out $User again >&2
  1261. X        OK=no
  1262. X    fi
  1263. X    
  1264. X    # get new version number and time stamp
  1265. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1266. X    # and register $User
  1267. X    $ACT $CVSLIB/RG.aux $User $VN_Rcs "$TS_User"
  1268. Xelse    # something is very wrong
  1269. X    # restore the old $User
  1270. X    $ACT mv $Orig $User
  1271. X    echo $Name: could not check in $User >&2
  1272. X    OK=no
  1273. X    if    # unlock $Rcs
  1274. X        $ACT $RCSBIN/rcs -u $Rcs
  1275. X    then    :
  1276. X    else
  1277. X        echo $Name: could not UNlock $Rcs >&2
  1278. X    fi
  1279. Xfi
  1280. + END-OF-FILE CI.aux
  1281. chmod 'u=rw,g=r,o=r' 'CI.aux'
  1282. set `wc -c 'CI.aux'`
  1283. count=$1
  1284. case $count in
  1285. 1734)    :;;
  1286. *)    echo 'Bad character count in ''CI.aux' >&2
  1287.         echo 'Count should be 1734' >&2
  1288. esac
  1289. echo Extracting 'CS.aux'
  1290. sed 's/^X//' > 'CS.aux' << '+ END-OF-FILE ''CS.aux'
  1291. X#    This file is part of the Concurrent Versions System CVS.
  1292. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1293. X#    $Header: CS.aux,v 3.1 89/09/25 16:30:17 dick Exp $
  1294. X
  1295. X#
  1296. X#        C o l l e c t   S e t s
  1297. X#    Script, to be included.
  1298. X#
  1299. X#    Assumes set:
  1300. X#        $@
  1301. X#        $CVSLIB
  1302. X#        $Name
  1303. X#        $User
  1304. X#        $VN_Rcs
  1305. X#        $VN_User
  1306. X#        $TS_Rcs
  1307. X#        $TS_User
  1308. X#
  1309. X#    Collects the interesting file names from the administration and
  1310. X#    the repository in a number of shell variables:
  1311. X#                            solved by:
  1312. X#        CLIST    conflict-ridden            (user)
  1313. X#        GLIST    modified, needs merging        (--/UV)
  1314. X#        MLIST    modified, needs checking in    (CM/--)
  1315. X#        OLIST    needs checking out        (--/UV)
  1316. X#        ALIST    to be added            (CM/--)
  1317. X#        RLIST    to be removed            (CM/--)
  1318. X#        WLIST    remove entry            (--/UV)
  1319. X#
  1320. X#    It sets OK to no if something is wrong.
  1321. X#
  1322. X
  1323. Xfor User in $@
  1324. Xdo
  1325. X    Rcs=$Repository/$User,v
  1326. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1327. X    
  1328. X    # what entry is this?
  1329. X    case $VN_User in
  1330. X    "")
  1331. X        # no entry available, $TS_Rcs is invalid
  1332. X        
  1333. X        # how is the RCS file?
  1334. X        case $VN_Rcs in
  1335. X        "")
  1336. X            # there is no RCS file either
  1337. X            
  1338. X            # how is the user file?
  1339. X            case "$TS_User" in
  1340. X            "")
  1341. X                # there is no user file
  1342. X                echo $Name: nothing known about $User >&2
  1343. X                OK=no
  1344. X                ;;
  1345. X            *)
  1346. X                # there is a user file
  1347. X                echo $Name: use AE to create entry \
  1348. X                                for $User >&2
  1349. X                OK=no
  1350. X                ;;
  1351. X            esac
  1352. X            ;;
  1353. X        *)
  1354. X            # there is an RCS file
  1355. X            
  1356. X            # how is the user file?
  1357. X            case "$TS_User" in
  1358. X            "")
  1359. X                # there is no user file
  1360. X                OLIST="$OLIST $User"
  1361. X                ;;
  1362. X            *)
  1363. X                # there is a user file
  1364. X                echo $Name: move away $User\; \
  1365. X                            it is in the way >&2
  1366. X                CLIST="$CLIST $User"
  1367. X                OK=no
  1368. X                ;;
  1369. X            esac
  1370. X            ;;
  1371. X        esac
  1372. X        ;;
  1373. X    
  1374. X    0)
  1375. X        # an entry for a new-born file, $TS_Rcs is dummy
  1376. X        
  1377. X        # how is the user file?
  1378. X        case "$TS_User" in
  1379. X        "")
  1380. X            # there is no user file, but there should be one
  1381. X            
  1382. X            echo $Name: warning: \
  1383. X                    new-born $User has disappeared >&2
  1384. X            WLIST="$WLIST $User"
  1385. X            ;;
  1386. X        *)
  1387. X            # there is a user file
  1388. X            
  1389. X            # how is the RCS file?
  1390. X            case $VN_Rcs in
  1391. X            "")
  1392. X                # there is no RCS file
  1393. X                
  1394. X                ALIST="$ALIST $User"
  1395. X                ;;
  1396. X            *)
  1397. X                # there is an RCS file
  1398. X                
  1399. X                echo $Name: conflict: $User created \
  1400. X                    independently by second party >&2
  1401. X                CLIST="$CLIST $User"
  1402. X                OK=no
  1403. X                ;;
  1404. X            esac
  1405. X            ;;
  1406. X        esac
  1407. X        ;;
  1408. X
  1409. X    -*)
  1410. X        # an entry for a removed file, $TS_Rcs is valid
  1411. X        
  1412. X        # how is the user file?
  1413. X        case "$TS_User" in
  1414. X        "")
  1415. X            # there is no user file (as it should be)
  1416. X            
  1417. X            # how is the RCS file?
  1418. X            case -$VN_Rcs in
  1419. X            -)
  1420. X                # there is no RCS file
  1421. X            
  1422. X                # this is all-right, however; it has been
  1423. X                # removed independently by second party
  1424. X                WLIST="$WLIST $User"
  1425. X                ;;
  1426. X            $VN_User)
  1427. X                # the RCS file is the same version as
  1428. X                # the user file
  1429. X                
  1430. X                # and that's OK
  1431. X                RLIST="$RLIST $User"
  1432. X                ;;
  1433. X            *)
  1434. X                # the RCS file is a newer version than
  1435. X                # the user file
  1436. X                
  1437. X                # and this is definitely not OK
  1438. X                echo $Name: conflict: removed $User was \
  1439. X                        modified by second party >&2
  1440. X                CLIST="$CLIST $User"
  1441. X                OK=no
  1442. X                ;;
  1443. X            esac
  1444. X            ;;
  1445. X        *)
  1446. X            # user file shouldn't be there
  1447. X            echo $Name: $User should be removed \
  1448. X                        and is still there >&2
  1449. X            OK=no
  1450. X            ;;
  1451. X        esac
  1452. X        ;;
  1453. X    
  1454. X    *)
  1455. X        # a normal entry, $TS_Rcs is valid
  1456. X        
  1457. X        # how is the RCS file?
  1458. X        case $VN_Rcs in
  1459. X        "")
  1460. X            # there is no RCS file
  1461. X            
  1462. X            # how is the user file?
  1463. X            case "$TS_User" in
  1464. X            "")
  1465. X                # there is no user file
  1466. X                echo $Name: warning: $User is not \
  1467. X                        \(no longer\) pertinent >&2
  1468. X                WLIST="$WLIST $User"
  1469. X                ;;
  1470. X            "$TS_Rcs")
  1471. X                # the user file is still unmodified
  1472. X                echo $Name: $User is no longer \
  1473. X                            in the repository >&2
  1474. X                WLIST="$WLIST $User"
  1475. X                ;;
  1476. X            *)
  1477. X                # the user file has been modified
  1478. X                echo $Name: conflict: $User is modified but \
  1479. X                    no longer in the repository >&2
  1480. X                CLIST="$CLIST $User"
  1481. X                OK=no
  1482. X                ;;
  1483. X            esac
  1484. X            ;;
  1485. X        $VN_User)
  1486. X            # the RCS file is the same version as the user file
  1487. X            
  1488. X            # how is the user file?
  1489. X            case "$TS_User" in
  1490. X            "")
  1491. X                # there is no user file
  1492. X                echo $Name: warning: $User was lost >&2
  1493. X                OLIST="$OLIST $User"
  1494. X                ;;
  1495. X            "$TS_Rcs")
  1496. X                # the user file is still unmodified
  1497. X                # nothing special at all!
  1498. X                ;;
  1499. X            *)
  1500. X                # the user file has been modified
  1501. X                # but do we believe it? This is complicated:
  1502. X                . $CVSLIB/ND.aux # sets MLIST, if necessary
  1503. X                ;;
  1504. X            esac
  1505. X            ;;
  1506. X        *)
  1507. X            # the RCS file is a newer version than the user file
  1508. X            
  1509. X            # how is the user file?
  1510. X            case "$TS_User" in
  1511. X            "")
  1512. X                # there is no user file
  1513. X                echo $Name: warning: $User was lost >&2
  1514. X                OLIST="$OLIST $User"
  1515. X                ;;
  1516. X            "$TS_Rcs")
  1517. X                # the user file is still unmodified
  1518. X                OLIST="$OLIST $User"
  1519. X                ;;
  1520. X            *)
  1521. X                # the user file has been modified
  1522. X                GLIST="$GLIST $User"
  1523. X                ;;
  1524. X            esac
  1525. X            ;;
  1526. X        esac
  1527. X        ;;
  1528. X    esac
  1529. Xdone
  1530. + END-OF-FILE CS.aux
  1531. chmod 'u=rwx,g=rx,o=rx' 'CS.aux'
  1532. set `wc -c 'CS.aux'`
  1533. count=$1
  1534. case $count in
  1535. 4680)    :;;
  1536. *)    echo 'Bad character count in ''CS.aux' >&2
  1537.         echo 'Count should be 4680' >&2
  1538. esac
  1539. echo Extracting 'EF.aux'
  1540. sed 's/^X//' > 'EF.aux' << '+ END-OF-FILE ''EF.aux'
  1541. X#!/bin/sh
  1542. X#    This file is part of the Concurrent Versions System CVS.
  1543. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1544. X#    $Header: EF.aux,v 3.1 89/09/25 16:31:12 dick Exp $
  1545. X
  1546. X#
  1547. X#        E n t r i e s   f i l e   t o   F i l e s   f i l e
  1548. X#    Creates a file CVS.adm/Files containing the names that comprise
  1549. X#    the project, from CVS.adm/Entries.
  1550. X#
  1551. X
  1552. X<CVS.adm/Entries sed '
  1553. X    /^-/d
  1554. X    s/.* \(.*\)|/\1/
  1555. X' |
  1556. Xsort >CVS.adm/Files
  1557. + END-OF-FILE EF.aux
  1558. chmod 'u=rwx,g=rx,o=rx' 'EF.aux'
  1559. set `wc -c 'EF.aux'`
  1560. count=$1
  1561. case $count in
  1562. 414)    :;;
  1563. *)    echo 'Bad character count in ''EF.aux' >&2
  1564.         echo 'Count should be 414' >&2
  1565. esac
  1566. echo Extracting 'FN.aux'
  1567. sed 's/^X//' > 'FN.aux' << '+ END-OF-FILE ''FN.aux'
  1568. X#!/bin/sh
  1569. X#    This file is part of the Concurrent Versions System CVS.
  1570. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1571. X#    $Header: FN.aux,v 3.1 89/09/25 16:31:20 dick Exp $
  1572. X
  1573. X#
  1574. X#        F i n d  N a m e s
  1575. X#    Writes to standard output all the pertinent file names, both from the
  1576. X#    administration (included those that were RMed) and from the
  1577. X#    repository $1, sorted. 
  1578. X#
  1579. X
  1580. X(
  1581. X    (cd $1; ls -a) | grep ',v$' | sed 's/,v$//'
  1582. X    (<CVS.adm/Entries sed 's/.* \(.*\)|/\1/')
  1583. X) |
  1584. Xsort -u
  1585. + END-OF-FILE FN.aux
  1586. chmod 'u=rwx,g=rx,o=rx' 'FN.aux'
  1587. set `wc -c 'FN.aux'`
  1588. count=$1
  1589. case $count in
  1590. 468)    :;;
  1591. *)    echo 'Bad character count in ''FN.aux' >&2
  1592.         echo 'Count should be 468' >&2
  1593. esac
  1594. echo Extracting 'HN.aux'
  1595. sed 's/^X//' > 'HN.aux' << '+ END-OF-FILE ''HN.aux'
  1596. X#    This file is part of the Concurrent Versions System CVS.
  1597. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1598. X#    $Header: HN.aux,v 3.1 89/09/25 16:31:41 dick Exp $
  1599. X
  1600. X#
  1601. X#        H e a d e r   N u m b e r
  1602. X#    Script, to be included.
  1603. X#
  1604. X#    Assumes set:
  1605. X#        $RCSBIN
  1606. X#        $User
  1607. X#
  1608. X#    Sets the following shell variable:
  1609. X#    HN_user        version number in the RCS Header in the file $User
  1610. X#            as found by $RCSBIN/ident; may also be empty, if
  1611. X#            there is no RCS Header.
  1612. X#
  1613. X
  1614. XHN_User=`
  1615. X    ($RCSBIN/ident $User 2>&1) |
  1616. X    grep 'Header: .*,v' |
  1617. X    sed '
  1618. X        s/.*,v //
  1619. X        s/ .*//
  1620. X    '
  1621. X`
  1622. X    
  1623. + END-OF-FILE HN.aux
  1624. chmod 'u=rw,g=r,o=r' 'HN.aux'
  1625. set `wc -c 'HN.aux'`
  1626. count=$1
  1627. case $count in
  1628. 547)    :;;
  1629. *)    echo 'Bad character count in ''HN.aux' >&2
  1630.         echo 'Count should be 547' >&2
  1631. esac
  1632. echo Extracting 'LR.aux'
  1633. sed 's/^X//' > 'LR.aux' << '+ END-OF-FILE ''LR.aux'
  1634. X#    This file is part of the Concurrent Versions System CVS.
  1635. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1636. X#    $Header: LR.aux,v 3.1 89/09/25 16:32:33 dick Exp $
  1637. X
  1638. X#
  1639. X#        L o c a t e   R C S   F i l e
  1640. X#    Script, to be included.
  1641. X#
  1642. X#    Assumes set:
  1643. X#        $Repository
  1644. X#        $User
  1645. X#
  1646. X#    Called when the RCS file sought may be in the attic $Repository/Attic.
  1647. X#    Sets $Rcs to $Repository/Attic/$User,v if appropriate and to
  1648. X#    $Repository/$User,v otherwise.
  1649. X#
  1650. X
  1651. XRcs=$Repository/$User,v
  1652. XOld=$Repository/Attic/$User,v
  1653. Xif    # it is in the repository
  1654. X    [ -r $Rcs ]
  1655. Xthen    :
  1656. Xelif    # it is in the attic
  1657. X    [ -r $Old ]
  1658. Xthen
  1659. X    Rcs=$Old
  1660. Xelse    # it is treated as if it were in the repository
  1661. X    :
  1662. Xfi
  1663. + END-OF-FILE LR.aux
  1664. chmod 'u=rw,g=r,o=r' 'LR.aux'
  1665. set `wc -c 'LR.aux'`
  1666. count=$1
  1667. case $count in
  1668. 661)    :;;
  1669. *)    echo 'Bad character count in ''LR.aux' >&2
  1670.         echo 'Count should be 661' >&2
  1671. esac
  1672. echo Extracting 'MF.aux'
  1673. sed 's/^X//' > 'MF.aux' << '+ END-OF-FILE ''MF.aux'
  1674. X#    This file is part of the Concurrent Versions System CVS.
  1675. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1676. X#    $Header: MF.aux,v 3.1 89/09/25 16:32:49 dick Exp $
  1677. X
  1678. X#
  1679. X#        M o d i f i e d   F i l e s
  1680. X#    Prints the names of the files that have been modified since the last
  1681. X#    CM.  The list is constructed by combining the contents of CVS.adm/Mod
  1682. X#    (verified to be really different) with time stamp information from
  1683. X#    CVS.adm/LastUpdate.
  1684. X#
  1685. X
  1686. X(    # list all files modified between last CM and last UV
  1687. X    cat CVS.adm/Mod
  1688. X
  1689. X    # list all files modified after last UV
  1690. X    # get the list of all files in the configuration and of
  1691. X    # CVS.adm/LastUpdate, sorted on time
  1692. X    ls -lt `cat CVS.adm/Files` CVS.adm/LastUpdate 2>/dev/null |
  1693. X    # remove the entry CVS.adm/LastUpdate and anything older
  1694. X    sed '/CVS.adm\/LastUpdate/,$d' |
  1695. X    # retrieve files name only
  1696. X    sed 's/.* //'
  1697. X) |
  1698. Xsort -u
  1699. + END-OF-FILE MF.aux
  1700. chmod 'u=rwx,g=rx,o=rx' 'MF.aux'
  1701. set `wc -c 'MF.aux'`
  1702. count=$1
  1703. case $count in
  1704. 857)    :;;
  1705. *)    echo 'Bad character count in ''MF.aux' >&2
  1706.         echo 'Count should be 857' >&2
  1707. esac
  1708. echo Extracting 'ND.aux'
  1709. sed 's/^X//' > 'ND.aux' << '+ END-OF-FILE ''ND.aux'
  1710. X#    This file is part of the Concurrent Versions System CVS.
  1711. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1712. X#    $Header: ND.aux,v 3.1 89/09/25 16:33:07 dick Exp $
  1713. X
  1714. X#
  1715. X#        N o   D i f f e r e n c e
  1716. X#    Script, to be included.
  1717. X#
  1718. X#    Assumes set:
  1719. X#        $ACT
  1720. X#        $CVSLIB
  1721. X#        $Name
  1722. X#        $RCSBIN
  1723. X#        $Rcs
  1724. X#        $TS_User
  1725. X#        $User
  1726. X#        $VN_Rcs
  1727. X#        $VN_User
  1728. X#
  1729. X#    The user file looks modified judging from its time stamp; however
  1730. X#    it needn't be.  ND.aux finds out whether it is or not.
  1731. X#    If it is, it adds its name to the $MLIST.
  1732. X#    If it is not, it updates the administration.
  1733. X#    It may set OK to 'no'.
  1734. X#
  1735. X
  1736. XTmp=,,$User
  1737. Xif    # we can retrieve a provisional copy of $Rcs
  1738. X    $RCSBIN/co -p -q -r$VN_User $Rcs >$Tmp
  1739. Xthen    # test for differences
  1740. X    if    # they are equal
  1741. X        cmp -s $User $Tmp
  1742. X    then    # there were no real user differences:
  1743. X        # update reference time stamp
  1744. X        TS_Rcs="$TS_User"
  1745. X        $ACT $CVSLIB/RG.aux $User $VN_Rcs "$TS_User"
  1746. X    else    # its name belongs in the MLIST
  1747. X        MLIST="$MLIST $User"
  1748. X    fi
  1749. X    
  1750. X    rm -f $Tmp
  1751. X    
  1752. Xelse    # something very wrong
  1753. X    echo $Name: could not check out revision $VN_User of $User >&2
  1754. X    rm $Tmp
  1755. X    OK=no
  1756. Xfi
  1757. X
  1758. + END-OF-FILE ND.aux
  1759. chmod 'u=rwx,g=rx,o=rx' 'ND.aux'
  1760. set `wc -c 'ND.aux'`
  1761. count=$1
  1762. case $count in
  1763. 1086)    :;;
  1764. *)    echo 'Bad character count in ''ND.aux' >&2
  1765.         echo 'Count should be 1086' >&2
  1766. esac
  1767. echo Extracting 'NR.aux'
  1768. sed 's/^X//' > 'NR.aux' << '+ END-OF-FILE ''NR.aux'
  1769. X#    This file is part of the Concurrent Versions System CVS.
  1770. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1771. X#    $Header: NR.aux,v 3.1 89/09/25 16:33:29 dick Exp $
  1772. X
  1773. X#
  1774. X#        N a m e   o f   R e p o s i t o r y
  1775. X#    Script, to be included.
  1776. X#
  1777. X#    Assumes set:
  1778. X#        $Name
  1779. X#        $Repository (optionally)
  1780. X#    Sets:
  1781. X#        $Repository
  1782. X#
  1783. X#    Determines the name of the RCS repository and sets $Repository
  1784. X#    accordingly. If $Repository is already set, then that is the name,
  1785. X#    otherwise the name is retrieved from CVS.adm/Repository.
  1786. X#    Checks the presence of the repository.
  1787. X#
  1788. X
  1789. Xif    [ "$Repository" = "" ]
  1790. Xthen    # retrieve CVS.adm/Repository
  1791. X    if    # there is no administration directory
  1792. X        [ ! -d CVS.adm ]
  1793. X    then
  1794. X        echo $Name: there is no configuration under CVS here\; \
  1795. X            do CV first >&2
  1796. X        exit 1
  1797. X    fi
  1798. X
  1799. X    if    # the necessary files are there
  1800. X        [ -r CVS.adm/Repository -a -r CVS.adm/Entries ]
  1801. X    then    # read the name of the RCS repository from the file
  1802. X        Repository=`cat CVS.adm/Repository`
  1803. X    else    # no good
  1804. X        echo $Name: \*PANIC\* administration files missing >&2
  1805. X        exit 1
  1806. X    fi
  1807. Xfi
  1808. X
  1809. Xif    # the promised repository isn't there
  1810. X    [ ! -d $Repository ]
  1811. Xthen
  1812. X    echo $Name: there is no repository $Repository >&2
  1813. X    exit 1
  1814. Xfi
  1815. X
  1816. Xexport Repository
  1817. + END-OF-FILE NR.aux
  1818. chmod 'u=rwx,g=rx,o=rx' 'NR.aux'
  1819. set `wc -c 'NR.aux'`
  1820. count=$1
  1821. case $count in
  1822. 1195)    :;;
  1823. *)    echo 'Bad character count in ''NR.aux' >&2
  1824.         echo 'Count should be 1195' >&2
  1825. esac
  1826. echo Extracting 'OP.aux'
  1827. sed 's/^X//' > 'OP.aux' << '+ END-OF-FILE ''OP.aux'
  1828. X#    This file is part of the Concurrent Versions System CVS.
  1829. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1830. X#    $Header: OP.aux,v 3.1 89/09/25 16:33:40 dick Exp $
  1831. X
  1832. X#
  1833. X#        O p t i o n s
  1834. X#    Script, to be included.
  1835. X#
  1836. X#    Collects options from $@ and puts them in $Options.
  1837. X#    Each option, including the first, will be preceded by a space.
  1838. X#
  1839. X
  1840. XGO_ON=true
  1841. Xwhile    # there may still be an option
  1842. X    $GO_ON
  1843. Xdo
  1844. X    case $1 in
  1845. X    -*)
  1846. X        Options="$Options $1"
  1847. X        shift
  1848. X        ;;
  1849. X    *)
  1850. X        GO_ON=false
  1851. X        ;;
  1852. X    esac
  1853. Xdone
  1854. + END-OF-FILE OP.aux
  1855. chmod 'u=rw,g=r,o=r' 'OP.aux'
  1856. set `wc -c 'OP.aux'`
  1857. count=$1
  1858. case $count in
  1859. 485)    :;;
  1860. *)    echo 'Bad character count in ''OP.aux' >&2
  1861.         echo 'Count should be 485' >&2
  1862. esac
  1863. echo Extracting 'RG.aux'
  1864. sed 's/^X//' > 'RG.aux' << '+ END-OF-FILE ''RG.aux'
  1865. X#!/bin/sh
  1866. X#    This file is part of the Concurrent Versions System CVS.
  1867. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1868. X#    $Header: RG.aux,v 3.1 89/09/25 16:34:19 dick Exp $
  1869. X
  1870. X#
  1871. X#        R e g i s t e r
  1872. X#    Enters file $1 into the administration with version number $2
  1873. X#    and time stamp $3.  Removes the old entry first, if necessary.
  1874. X#
  1875. X#    Assumes set:
  1876. X#        $CVSLIB
  1877. X#
  1878. X
  1879. X$CVSLIB/SC.aux $1            # scratch the entry
  1880. Xecho "$2|$3|" >>CVS.adm/Entries        # and append a new one
  1881. + END-OF-FILE RG.aux
  1882. chmod 'u=rwx,g=rx,o=rx' 'RG.aux'
  1883. set `wc -c 'RG.aux'`
  1884. count=$1
  1885. case $count in
  1886. 456)    :;;
  1887. *)    echo 'Bad character count in ''RG.aux' >&2
  1888.         echo 'Count should be 456' >&2
  1889. esac
  1890. echo Extracting 'SC.aux'
  1891. sed 's/^X//' > 'SC.aux' << '+ END-OF-FILE ''SC.aux'
  1892. X#!/bin/sh
  1893. X#    This file is part of the Concurrent Versions System CVS.
  1894. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1895. X#    $Header: SC.aux,v 3.1 89/09/25 16:34:48 dick Exp $
  1896. X
  1897. X#
  1898. X#        S c r a t c h
  1899. X#    Scratches file $1 from the administration
  1900. X#
  1901. X
  1902. Xmv CVS.adm/Entries CVS.adm/Entries.Backup
  1903. Xfgrep -v " $1|" CVS.adm/Entries.Backup >CVS.adm/Entries
  1904. + END-OF-FILE SC.aux
  1905. chmod 'u=rwx,g=rx,o=rx' 'SC.aux'
  1906. set `wc -c 'SC.aux'`
  1907. count=$1
  1908. case $count in
  1909. 343)    :;;
  1910. *)    echo 'Bad character count in ''SC.aux' >&2
  1911.         echo 'Count should be 343' >&2
  1912. esac
  1913. echo Extracting 'SL.aux'
  1914. sed 's/^X//' > 'SL.aux' << '+ END-OF-FILE ''SL.aux'
  1915. X#    This file is part of the Concurrent Versions System CVS.
  1916. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1917. X#    $Header: SL.aux,v 3.1 89/09/25 16:34:58 dick Exp $
  1918. X
  1919. X#
  1920. X#        S e t   L o c k
  1921. X#    Script, to be included.
  1922. X#
  1923. X#    Assumes set:
  1924. X#        $Name
  1925. X#        $Repository
  1926. X#        $LCK        name of lock
  1927. X#
  1928. X#    Persistently tries to make the directory $LCK, which serves as
  1929. X#    a lock.
  1930. X#
  1931. X
  1932. Xuntil    # we can enter the critical section
  1933. X    trap '' 1 2 3 15        # play deaf
  1934. X    mkdir $LCK >/dev/null 2>/dev/null
  1935. Xdo
  1936. X    # we missed it this cycle
  1937. X    echo $Name: `date`: waiting for access to $Repository
  1938. X    
  1939. X    # sleep with both ears open
  1940. X    trap 'exit 1' 1 2 3 15
  1941. X    sleep 60
  1942. Xdone
  1943. + END-OF-FILE SL.aux
  1944. chmod 'u=rw,g=r,o=r' 'SL.aux'
  1945. set `wc -c 'SL.aux'`
  1946. count=$1
  1947. case $count in
  1948. 622)    :;;
  1949. *)    echo 'Bad character count in ''SL.aux' >&2
  1950.         echo 'Count should be 622' >&2
  1951. esac
  1952. echo Extracting 'VN.aux'
  1953. sed 's/^X//' > 'VN.aux' << '+ END-OF-FILE ''VN.aux'
  1954. X#!/bin/sh
  1955. X#    This file is part of the Concurrent Versions System CVS.
  1956. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1957. X#    $Header: VN.aux,v 3.1 89/09/25 16:35:19 dick Exp $
  1958. X
  1959. X#
  1960. X#        V e r s i o n   N u m b e r
  1961. X#    Writes the version number of the most recent revision of $1
  1962. X#    to standard output.
  1963. X#    This is sloppy, but the only way to do it, short of analyzing
  1964. X#    the *,v file itself.
  1965. X#
  1966. X#    Assumes set:
  1967. X#        $RCSBIN
  1968. X#
  1969. X
  1970. X(    #    The following stupid construction is necessary, since the
  1971. X    #    shell sometimes generates a NL when a pipe breaks, as it
  1972. X    #    does here, where sed stops after a few lines.  Letting
  1973. X    #    sed process all the rest is also a shame.
  1974. X    #
  1975. X$RCSBIN/rlog $1 |
  1976. Xsed -n '
  1977. X    /^head:/{
  1978. X        s/.* //p
  1979. X        q
  1980. X    }
  1981. X'
  1982. X) 2>/dev/null
  1983. + END-OF-FILE VN.aux
  1984. chmod 'u=rwx,g=rx,o=rx' 'VN.aux'
  1985. set `wc -c 'VN.aux'`
  1986. count=$1
  1987. case $count in
  1988. 714)    :;;
  1989. *)    echo 'Bad character count in ''VN.aux' >&2
  1990.         echo 'Count should be 714' >&2
  1991. esac
  1992. echo Extracting 'VT.aux'
  1993. sed 's/^X//' > 'VT.aux' << '+ END-OF-FILE ''VT.aux'
  1994. X#    This file is part of the Concurrent Versions System CVS.
  1995. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1996. X#    $Header: VT.aux,v 3.1 89/09/25 16:35:27 dick Exp $
  1997. X
  1998. X#
  1999. X#        V e r s i o n   &   T i m e   S t a m p
  2000. X#    Script, to be included.
  2001. X#
  2002. X#    Assumes set:
  2003. X#        $CVSLIB
  2004. X#        $Rcs
  2005. X#        $User
  2006. X#
  2007. X#    Sets the following shell variables:
  2008. X#    VN_User        version # of the RCS file the user file derives from
  2009. X#            may also be:
  2010. X#                empty:        no entry for user file
  2011. X#                0:        user file is new
  2012. X#                -$VN_User:    user file is to be removed
  2013. X#    VN_Rcs        version # of active RCS file
  2014. X#                is empty for absent RCS file
  2015. X#    TS_User        present time stamp of the user file
  2016. X#                is empty for absent user file
  2017. X#    TS_Rcs        time stamp of the lastest check-out of the RCS file.
  2018. X#
  2019. X#    The syntax of an entry is
  2020. X#        <version-number>|<time-stamp>|
  2021. X#    and since the time stamp is obtained through ls, it includes
  2022. X#    the file name.
  2023. X#
  2024. X
  2025. XVN_Rcs=`$CVSLIB/VN.aux $Rcs`
  2026. X
  2027. Xif    # the user file exists
  2028. X    [ -r $User ]
  2029. Xthen    #get its time stamp
  2030. X    TS_User=`ls -ld $User`
  2031. Xelse    # yield null
  2032. X    TS_User=
  2033. Xfi
  2034. X
  2035. XENTRY=`fgrep " $User|" CVS.adm/Entries`
  2036. Xif    # the entry is non-empty
  2037. X    [ "$ENTRY" != "" ]
  2038. Xthen    # dissect it
  2039. X    VN_User=`expr "$ENTRY" : '\(.*\)|.' `
  2040. X    TS_Rcs=`expr "$ENTRY" : '.*|\(.*\)|' `
  2041. Xelse    # yield nulls
  2042. X    VN_User=
  2043. X    TS_Rcs=
  2044. Xfi
  2045. + END-OF-FILE VT.aux
  2046. chmod 'u=rwx,g=rx,o=rx' 'VT.aux'
  2047. set `wc -c 'VT.aux'`
  2048. count=$1
  2049. case $count in
  2050. 1253)    :;;
  2051. *)    echo 'Bad character count in ''VT.aux' >&2
  2052.         echo 'Count should be 1253' >&2
  2053. esac
  2054. echo Extracting 'WL.aux'
  2055. sed 's/^X//' > 'WL.aux' << '+ END-OF-FILE ''WL.aux'
  2056. X#    This file is part of the Concurrent Versions System CVS.
  2057. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  2058. X#    $Header: WL.aux,v 3.2 89/10/13 12:04:40 dick Exp $
  2059. X
  2060. X#
  2061. X#        W r i t e   L o c k
  2062. X#    Script, to be included.
  2063. X#
  2064. X#    Assumes set:
  2065. X#        $Repository
  2066. X#        $Name
  2067. X#        $CVSLIB
  2068. X#        $AutoRemove        set to yes if lock is to be removed
  2069. X#                    automatically upon script exit
  2070. X#
  2071. X#    Sets a write lock in $Repository for exclusive write access
  2072. X#
  2073. X
  2074. XLCK=$Repository/\#cvs.lock        # the lock
  2075. XTFL=$Repository/\#cvs.tfl.$$        # a temporary test file
  2076. XRFL=$Repository/\#cvs.rfl        # pattern of the read flags
  2077. XWFL=$Repository/\#cvs.wfl        # the general write flag
  2078. X
  2079. X# do we have write access at all?
  2080. Xif    # we can write at all
  2081. X    cp /dev/null $TFL >/dev/null 2>/dev/null
  2082. Xthen    # OK so far
  2083. X    rm $TFL
  2084. Xelse    # not so OK
  2085. X    echo $Name: you have no write permission in $Repository >&2
  2086. X    exit 1
  2087. Xfi
  2088. X
  2089. X# set the lock itself
  2090. X. $CVSLIB/SL.aux            # persistently tries to mkdir $LCK
  2091. X
  2092. X# set trap to remove flag and lock on interrupt
  2093. Xtrap 'rm -f $WFL; rmdir $LCK; exit 1' 1 2 3 15
  2094. X
  2095. X# conditionally set trap to remove flag and lock on exit
  2096. Xcase "$AutoRemove" in
  2097. Xyes)    # lock to be removed automatically upon exit
  2098. X    trap 'rm -f $WFL; rmdir $LCK; exit 0' 0
  2099. X    ;;
  2100. Xesac
  2101. X
  2102. X# start of critical section
  2103. X
  2104. X# notify others of intention
  2105. Xcp /dev/null $WFL            # plant write flag
  2106. X
  2107. X# wait for the readers to disappear
  2108. Xwhile    # there are still read flags
  2109. X    [ "`echo $RFL.* | grep -v '\*'`" != "" ]
  2110. Xdo
  2111. X    echo $Name: `date`: waiting for readers to disappear from $Repository
  2112. X    sleep 60
  2113. Xdone
  2114. X
  2115. X# the caller of WL.aux can now write in safety
  2116. X
  2117. + END-OF-FILE WL.aux
  2118. chmod 'u=rw,g=r,o=r' 'WL.aux'
  2119. set `wc -c 'WL.aux'`
  2120. count=$1
  2121. case $count in
  2122. 1548)    :;;
  2123. *)    echo 'Bad character count in ''WL.aux' >&2
  2124.         echo 'Count should be 1548' >&2
  2125. esac
  2126. echo Extracting 'historian'
  2127. sed 's/^X//' > 'historian' << '+ END-OF-FILE ''historian'
  2128. X#!/bin/sh
  2129. X#    This file is part of the Concurrent Versions System CVS.
  2130. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  2131. X#    $Header: historian,v 3.1 89/09/25 16:36:25 dick Exp $
  2132. X
  2133. X#
  2134. X#    Historian: ad-hoc configuration history reconstruction program
  2135. X#
  2136. X#        historian [ repository ]
  2137. X#    attempts to reconstruct the configuration history file of the
  2138. X#    repository, using reasonable(?) heuristics.  If no repository is given,
  2139. X#    the repository of the present directory is used.
  2140. X#
  2141. X#    This simple script assumes that there are no "removed files", i.e.,
  2142. X#    that the Attic is non-existent or empty.
  2143. X#
  2144. XName=historian; export Name
  2145. X
  2146. X# CVSBIN, CVSLIB and RCSBIN directories
  2147. XCVSBIN=/home/top/dick/cvs
  2148. XCVSLIB=/home/top/dick/cvs
  2149. XRCSBIN=${RCSBIN-/usr/local/bin}
  2150. Xexport CVSBIN CVSLIB RCSBIN
  2151. X
  2152. X# avoid spurious identifications
  2153. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  2154. X
  2155. X# determine the name of the repository
  2156. XRepository=$1
  2157. X. $CVSLIB/NR.aux
  2158. X
  2159. X# worry about the Attic
  2160. Xif    # there is an Attic
  2161. X    [ -d $Repository/Attic ]
  2162. Xthen    # it may still be empty
  2163. X    REMOVED=`ls $Repository/Attic`
  2164. Xfi
  2165. X
  2166. Xif    # some files have been removed
  2167. X    [ -n "$REMOVED" ]
  2168. Xthen    # tell the truth
  2169. X    echo "The configuration history file reconstructed for $Repository"
  2170. X    echo "will not be completely correct, although it is still a good"
  2171. X    echo "approximation. Obtaining a correct configuration history file"
  2172. X    echo "requires manual assistance concerning the removal dates of"
  2173. X    echo "$REMOVED" |
  2174. X    sed 's/,v//'
  2175. X    echo "See the manual page of 'historian' for further information."
  2176. X    echo ""
  2177. Xfi
  2178. X
  2179. X$CVSBIN/hist1 $Repository |
  2180. X$CVSBIN/hist2 $Repository |
  2181. Xsh
  2182. X
  2183. + END-OF-FILE historian
  2184. chmod 'u=rwx,g=rx,o=rx' 'historian'
  2185. set `wc -c 'historian'`
  2186. count=$1
  2187. case $count in
  2188. 1576)    :;;
  2189. *)    echo 'Bad character count in ''historian' >&2
  2190.         echo 'Count should be 1576' >&2
  2191. esac
  2192. echo Extracting 'hist1'
  2193. sed 's/^X//' > 'hist1' << '+ END-OF-FILE ''hist1'
  2194. X#!/bin/sh
  2195. X#    This file is part of the Concurrent Versions System CVS.
  2196. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  2197. X#    $Header: hist1,v 3.2 89/10/13 11:54:39 dick Exp $
  2198. X
  2199. X#
  2200. X#    Historian: ad-hoc configuration history reconstruction program, part 1
  2201. X#
  2202. X#        hist1 [ repository ]
  2203. X#    writes on standard output phase 1 of the reconstruction of the
  2204. X#    configuration history file of the repository, using reasonable(?)
  2205. X#    heuristics. If no repository is given, the repository of the present
  2206. X#    directory is used.
  2207. X#
  2208. XName=hist1; export Name
  2209. X
  2210. X# CVSBIN, CVSLIB and RCSBIN directories
  2211. XCVSBIN=/home/top/dick/cvs
  2212. XCVSLIB=/home/top/dick/cvs
  2213. XRCSBIN=${RCSBIN-/usr/local/bin}
  2214. Xexport CVSBIN CVSLIB RCSBIN
  2215. X
  2216. X# avoid spurious identifications
  2217. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  2218. X
  2219. X# determine the name of the repository
  2220. XRepository=$1
  2221. X. $CVSLIB/NR.aux
  2222. X
  2223. X# get the whole rlog of all files
  2224. XRCSFILES=`
  2225. X    ls $Repository/*,v $Repository/.*,v \
  2226. X        $Repository/Attic/*,v $Repository/Attic/.*,v 2>/dev/null |
  2227. X    grep -v "\*"
  2228. X`
  2229. Xfor Rcs in $RCSFILES
  2230. Xdo
  2231. X    $RCSBIN/rlog $Rcs
  2232. Xdone |
  2233. X
  2234. X# remove all kinds of garbage
  2235. Xtr '\200-\377' '' |
  2236. X
  2237. X# identify and combine revision and date lines
  2238. Xsed '
  2239. X    /^--*$/{
  2240. X        N
  2241. X        s/\nrevision /\
  2242. X<REV> /
  2243. X        N
  2244. X        s/\ndate: / /
  2245. X        s/; *author:/ /
  2246. X        s/;.*//
  2247. X    }
  2248. X    /^==*$/s/.*/----------------------------/
  2249. X' |
  2250. X
  2251. X# construct one line for each file modification
  2252. Xawk '
  2253. X    $1 == "RCS" && running == 0 {
  2254. X        # establish file name
  2255. X        fname = $6;
  2256. X    }
  2257. X    $1 == "<REV>" {
  2258. X        # print            date time fname rev author
  2259. X        printf("%s %s %s %s %s ; ", $3, $4, fname, $2, $5);
  2260. X        running = 1;
  2261. X    }
  2262. X    $1 ~ /^--*$/ && running != 0 {
  2263. X        # revision description terminator
  2264. X        printf("\n");
  2265. X    }
  2266. X    $1 != "<REV>" && $1 !~ /^--*$/ && running != 0 {
  2267. X        # one line of revision description
  2268. X        if (running > 1) {
  2269. X            # multi-line revision message
  2270. X            printf("\\n");
  2271. X        }
  2272. X        printf("%s", $0);
  2273. X        running++;
  2274. X    }
  2275. X' |
  2276. X
  2277. X# sort on date and time
  2278. Xsort -n |
  2279. X
  2280. X# put a separator after each group of identical messages
  2281. Xawk -F\; '
  2282. X    {    if (msg != "" && $2 != msg) {print ""; }
  2283. X        msg = $2;
  2284. X        print;
  2285. X    }
  2286. X    END    {
  2287. X        if (msg != "") {print ""; }
  2288. X    }
  2289. X'
  2290. X
  2291. Xexit 0
  2292. X
  2293. + END-OF-FILE hist1
  2294. chmod 'u=rwx,g=rx,o=rx' 'hist1'
  2295. set `wc -c 'hist1'`
  2296. count=$1
  2297. case $count in
  2298. 2055)    :;;
  2299. *)    echo 'Bad character count in ''hist1' >&2
  2300.         echo 'Count should be 2055' >&2
  2301. esac
  2302. exit 0 # Just in case...
  2303.