home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / cvs / part1 next >
Encoding:
Text File  |  1986-11-30  |  45.6 KB  |  1,979 lines

  1. Subject: v06i040:  CVS, an RCS front-end (cvs), Part1/2
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.UUCP
  4.  
  5. Submitted by: Dick Grune <seismo!mcvax!vu44!dick>
  6. Mod.sources: Volume 6, Issue 40
  7. Archive-name: cvs/Part1
  8.  
  9. This is CVS, Concurrent Versions System, a front end for RCS.  It
  10. supports the concurrent and independent use of an RCS directory by
  11. several people.  We have been using it for half a year now, on various
  12. projects.  It uses the RCS programs rcs, ci, co, rcsmerge and rlog in
  13. such a way that you can do a multi-file commit, etc.  It is all shell
  14. scripts.
  15.                     Dick Grune
  16.                     Vrije Universiteit
  17.                     de Boelelaan 1081
  18.                     1081 HV  Amsterdam
  19.                     the Netherlands
  20.  
  21.  
  22. : This is a shar archive.  Extract with sh, not csh.
  23. : --------------------------- cut here --------------------------
  24. PATH=/bin:/usr/bin
  25. echo Extracting \R\E\A\D\_\M\E
  26. sed 's/^X//' > \R\E\A\D\_\M\E << '+ END-OF-FILE '\R\E\A\D\_\M\E
  27. X#    This file is part of the Concurrent Versions System CVS.
  28. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  29. X#    $Header: READ_ME,v 1.8 86/06/15 18:03:16 dick Exp $
  30. X
  31. XCVS is an front end for RCS, supporting the concurrent and independent
  32. Xuse of an RCS directory by several people.  See manual page cvs.1.
  33. X
  34. XThis set of shell scripts assumes the presence of the RCS programs
  35. Xrcs, ci, co, rcsmerge and rlog (by Walter Tichy).
  36. X
  37. XTo install, examine the Makefile and give suitable values to:
  38. X
  39. XCVSBIN    the directory for the commands themselves    eg. /usr/local
  40. XCVSLIB    idem for the auxiliaries            eg. /usr/lib/local/cvs
  41. XCVSMAN    idem for the manual page cvs.1            eg. /usr/man/man1
  42. XRCSBIN    the directory that holds the RCS programs    eg. /usr/bin
  43. X
  44. XThen call     make install
  45. X
  46. XBe sure you can write/create:
  47. X    in $(CVSBIN): AE CM CV DF GC LS RM RV SV UV
  48. X    in $(CVSLIB): anything
  49. X    in $(CVSMAN): cvs.1
  50. X
  51. XNOTE:
  52. XIf you have been using CVS already, you may have directories named ".old";
  53. Xthey are now named "Attic".  Please rename any you have before starting to
  54. Xuse this release.
  55. + END-OF-FILE READ_ME
  56. chmod 'u=rw,g=r,o=r' \R\E\A\D\_\M\E
  57. set `sum \R\E\A\D\_\M\E`
  58. sum=$1
  59. case $sum in
  60. 20307)    :;;
  61. *)    echo 'Bad sum in '\R\E\A\D\_\M\E >&2
  62. esac
  63. echo Extracting \M\a\k\e\f\i\l\e
  64. sed 's/^X//' > \M\a\k\e\f\i\l\e << '+ END-OF-FILE '\M\a\k\e\f\i\l\e
  65. X#    This file is part of the Concurrent Versions System CVS.
  66. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  67. X#    $Header: Makefile,v 1.24 86/06/22 18:12:37 dick Exp $
  68. X
  69. XCVSBIN = /user1/dick/bin#        # where to install the CVS programs
  70. XCVSLIB = /user1/dick/lib/cvs#        # where to install the CVS auxiliaries
  71. XCVSMAN = /user1/dick/man#        # where to install the CVS manual
  72. XRCSBIN = /usr/new#            # where the RCS binaries reside
  73. X
  74. XINF =    READ_ME Makefile Install cvs.1
  75. XPRG =    AE CM CV DF GC LS RM RV SV UV
  76. XAUX =    BE.aux CA.aux CI.aux CS.aux EF.aux FN.aux LR.aux ND.aux NR.aux \
  77. X    OP.aux RG.aux SC.aux SL.aux VN.aux VT.aux
  78. X
  79. Xwhat:
  80. X    @echo "Call is: make [ install | print | shar | clean ]"
  81. X
  82. Xinstall:    install.files $(CVSMAN)/cvs.1
  83. X
  84. Xinstall.files:
  85. X    for F in $(PRG); do ./Install $$F $(CVSBIN) $(CVSLIB) $(RCSBIN); done
  86. X    for F in $(AUX); do ./Install $$F $(CVSLIB) $(CVSLIB) $(RCSBIN); done
  87. X
  88. X$(CVSMAN)/cvs.1:    cvs.1
  89. X    cp cvs.1 $(CVSMAN)/cvs.1
  90. X
  91. X# create a (composite) shar file shar[12]
  92. Xshar:    shar1 shar2
  93. X
  94. Xshar1:    $(INF) $(PRG) Makefile
  95. X    shar $(INF) $(PRG) >shar1
  96. X
  97. Xshar2:    $(AUX) Makefile
  98. X    shar $(AUX) >shar2
  99. X
  100. X# the whole set:
  101. XFLS =    $(INF) ChangeLog $(PRG) $(AUX)
  102. X
  103. Xprint:    $(FLS) Makefile
  104. X    pr $(FLS) >print
  105. X
  106. Xclean:
  107. X    rm -f shar[12] print
  108. X
  109. + END-OF-FILE Makefile
  110. chmod 'u=rw,g=r,o=r' \M\a\k\e\f\i\l\e
  111. set `sum \M\a\k\e\f\i\l\e`
  112. sum=$1
  113. case $sum in
  114. 57177)    :;;
  115. *)    echo 'Bad sum in '\M\a\k\e\f\i\l\e >&2
  116. esac
  117. echo Extracting \I\n\s\t\a\l\l
  118. sed 's/^X//' > \I\n\s\t\a\l\l << '+ END-OF-FILE '\I\n\s\t\a\l\l
  119. X#!/bin/sh
  120. X#    This file is part of the Concurrent Versions System CVS.
  121. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  122. X#    $Header: Install,v 1.9 86/06/13 18:00:24 dick Exp $
  123. X
  124. X#
  125. X#        I n s t a l l
  126. X#    Installs $1 in the directory $2; the file is updated to reflect
  127. X#    that the auxiliaries are in $3 and the RCS binaries in $4.
  128. X#    The directory names $2, $3 and $4 have to be absolute paths.
  129. X#    The pair "[ ... ]", used for testing in more advanced shells, is
  130. X#    replaced by the more portable "test ..."
  131. X#    So, a call might look like
  132. X#        Install GC /usr/local `pwd` /usr/local
  133. X#
  134. X
  135. Xcat $1 |
  136. Xsed "
  137. X    s|^CVSBIN=.*|CVSBIN=$2|
  138. X    s|^CVSLIB=.*|CVSLIB=$3|
  139. X    s|^RCSBIN=.*|RCSBIN=\${RCSBIN-$4}|
  140. X    s|^\([^#]*\)\[ \(.*\) \]|\1test \2|
  141. X" >$2/$1
  142. X
  143. Xchmod +x $2/$1
  144. + END-OF-FILE Install
  145. chmod 'u=rwx,g=rx,o=rx' \I\n\s\t\a\l\l
  146. set `sum \I\n\s\t\a\l\l`
  147. sum=$1
  148. case $sum in
  149. 19502)    :;;
  150. *)    echo 'Bad sum in '\I\n\s\t\a\l\l >&2
  151. esac
  152. echo Extracting \c\v\s\.\1
  153. sed 's/^X//' > \c\v\s\.\1 << '+ END-OF-FILE '\c\v\s\.\1
  154. X.\"    This file is part of the Concurrent Versions System CVS.
  155. X.\"    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  156. X.\"    $Header: cvs.1,v 1.18 86/06/22 18:15:13 dick Exp $
  157. X.TH CVS 1 86/06/14 "Vrije Universiteit"
  158. X.SH NAME
  159. Xcvs \- concurrent-versions system
  160. X.SH SYNOPSIS
  161. X.B CV
  162. XRCS-directory
  163. X.br
  164. X.B UV
  165. X[
  166. X.B \-n
  167. X] [ filename ... ]
  168. X.br
  169. X.B CM
  170. X[
  171. X.B \-n
  172. X] 'log-message' [ filename ... ]
  173. X.br
  174. X.B AE
  175. X[ \-... ] filename ...
  176. X.br
  177. X.B RM
  178. Xfilename ...
  179. X.br
  180. X.B LS
  181. Xfilename ...
  182. X.br
  183. X.B DF
  184. X[ \-... ] [ filename ... ]
  185. X.br
  186. X.B GC
  187. X.br
  188. X.B SV
  189. X.br
  190. X.B RV
  191. XRCS-directory SV-record
  192. X.SH DESCRIPTION
  193. X.I CVS
  194. Xsupports the concurrent use of independent versions of an RCS directory,
  195. Xand as such acts as a front end for RCS.  The user is not required
  196. Xto know RCS commands or ever give them.  The original files of a
  197. Xproject reside in an RCS directory, called the
  198. X.I repository,
  199. Xand are handled by the above commands only. The casual user uses
  200. X.I UV
  201. Xand
  202. X.I CM
  203. Xand may use
  204. X.I CV,
  205. X.I DF
  206. Xand
  207. X.I LS;
  208. Xthe other commands are for maintenance only.
  209. X.PP
  210. XEach participant in the project has his own private copy of the
  211. Xfiles; such a copy is called a
  212. X.I version.
  213. XEach participant can work on his copy at his convenience since it
  214. Xis totally his; the command
  215. X.I UV
  216. X(Update Version)
  217. Xwill merge updates to the repository into his files without
  218. Xdisturbing his own modifications; he can merge his own modifications back
  219. Xinto the repository with the command
  220. X.I CM
  221. X(commit).  Concurrency conflicts, which turn out to be rare anyway,
  222. Xare almost always detected.  The repository is protected by
  223. Xmulti-reader single-writer locks.  There is a simple facility for
  224. Xsubdirectories; see below.
  225. X.PP
  226. X.B Commands.
  227. X.br
  228. X.B CV
  229. X(Create Version) creates a "version" of an RCS repository.  This version
  230. Xis owned totally by the user and is actually an independent
  231. Xcopy, to be dealt with as seen fit.  Once
  232. X.I CV
  233. Xhas been called
  234. Xin a given directory, it never needs to be called again.  The
  235. Xuser can keep up-to-date by calling
  236. X.I UV
  237. Xwhen he feels like it;
  238. Xthis will supply him with a merge of his own modifications
  239. Xand the changes made in the RCS original.  See
  240. X.I UV
  241. Xfor details.
  242. X.PP
  243. XWhen the user is satisfied with his own modifications, the
  244. Xpresent version can be committed by
  245. X.I CM
  246. X(ComMit); this keeps the present
  247. Xversion in tact.
  248. X.PP
  249. XThe call is
  250. X.br
  251. X    CV
  252. X.I repository-name
  253. X.br
  254. Xwith preferably the full path name of the RCS repository.
  255. X.I CV
  256. Xwill then make the initial copy (at RCS speed).  Files in the
  257. Xworking directory with names that also occur in the repository are
  258. Xsupposed to derive already from the RCS files.
  259. X.PP
  260. X.I CV
  261. Xcreates a directory
  262. X.I ./CVS.adm,
  263. Xin which
  264. X.I CVS
  265. Xkeeps its administration, in two files,
  266. X.I Repository
  267. Xand
  268. X.I Entries.
  269. XThe first contains the name
  270. Xof the repository.  The second contains one line for each
  271. Xregistered file, consisting of the version number it derives from,
  272. Xits time stamp at derivation time and its name.  Both files
  273. Xare normal files and can be edited by the user, if need be (when
  274. Xthe repository is moved, e.g.).
  275. X.I CVS
  276. Xmaintains two more files, for user information;
  277. X.I ./CVS.adm/Files
  278. Xcontains the names of the files in the present version;
  279. X.I ./CVS.adm/Mod
  280. Xcontains information about files modified between the latest
  281. X.I CM
  282. Xand the latest
  283. X.I UV.
  284. XThe user can consult these files but modifying them has no effect.
  285. X.PP
  286. X.B UV
  287. X(Update Version) updates the version in the present directory with respect to
  288. Xthe RCS repository.  The present version must have been created by
  289. X.I CV.
  290. XThe call is
  291. X.br
  292. X    UV [ \-n ]
  293. X.br
  294. Xfor a general update, or
  295. X.br
  296. X    UV [ \-n ]
  297. X.I file ...
  298. X.br
  299. Xfor a partial update.
  300. X.PP
  301. XModified or new RCS files are checked out.
  302. XModified user files are reported on standard output
  303. Xas
  304. X.I "M\ user_file."
  305. XIf both the
  306. XRCS file and the user file have been modified, the user file
  307. Xis replaced by the result of
  308. X.I rcsmerge.
  309. XIf this throws up irreconcilable differences, the file is reported as
  310. X.I "C\ user_file,"
  311. Xand as
  312. X.I "M\ user_file"
  313. Xotherwise.
  314. XFiles added but not yet committed are reported as
  315. X.I "A\ user_file."
  316. XFiles removed but not yet decommitted are reported as
  317. X.I "R\ user_file."
  318. X.PP
  319. XIf the present directory contains subdirectories that hold
  320. Xconcurrent versions, these are updated as well.  (See, however,
  321. X.IR CM .)
  322. X.PP
  323. XThe
  324. X.B \-n
  325. Xoption restricts the actions to reporting only.
  326. X.PP
  327. X.B CM
  328. X(ComMit) commits the present version to the RCS repository, AFTER
  329. Xhaving done a test on conflicts.  The call is
  330. X.br
  331. X    CM [ \-n ]
  332. X.I log-message
  333. X.br
  334. Xfor a general commit, and
  335. X.br
  336. X    CM [ \-n ]
  337. X.I "log-message file ..."
  338. X.br
  339. Xfor a (dangerous) partial commit. The
  340. X.I log-message
  341. Xis obligatory, and
  342. Xwill be stored in the repository.
  343. X.PP
  344. XIf the present directory contains subdirectories that hold
  345. Xconcurrent versions, these are NOT committed.  (See, however,
  346. X.IR UV .)
  347. X.PP
  348. XThe
  349. X.B \-n
  350. Xoption restricts the actions to reporting only.
  351. X.PP
  352. X.B AE
  353. X(Add Entries) adds new entries to the
  354. Xpresent version; the options
  355. X.I \-...
  356. Xwill be passed on
  357. Xto
  358. X.I rcs \-i
  359. X(see RCS manual).  For each file it asks for a
  360. Xdescription, in RCS fashion.
  361. XThe entries will be added to the RCS repository upon the
  362. Xnext call of
  363. X.I CM.
  364. XThe user files must already exist.
  365. X.I AE
  366. Xon a file removed with
  367. X.I RM
  368. Xwill resurrect the file, unless its removal has already been
  369. Xcommitted.
  370. X.PP
  371. X.B RM
  372. X(ReMove) marks the entries as removed on purpose from the present version.
  373. XThe RCS files will be actually removed from the RCS repository upon the
  374. Xnext
  375. X.I CM;
  376. Xthey will be moved to a directory
  377. X.I Attic
  378. Xin the repository.
  379. X.PP
  380. X.B LS
  381. Xprints three lines of information for each of its arguments,
  382. Xone for the user file (line 1), one for the newest RCS file
  383. X(line 3) and one for the RCS file both derive from (line 2).
  384. X.PP
  385. X.B DF
  386. Xdoes a nice form of diff(1) on each of its arguments and the
  387. XRCS file that argument derives from.
  388. XIf there are options, these are passed to diff(1) and the diff
  389. Xformat is adhered to; otherwise a more readable format is produced.
  390. XStandard diff(1) format can also be forced by a single \-.
  391. XIf there are no file names, the names of the interesting files
  392. Xare taken from
  393. X.I CVS.adm/Mod
  394. X(which is updated every time
  395. X.I UV
  396. Xis called).  If the option is
  397. X.B \-n,
  398. Xdiff(1) will not be called, but the contents of
  399. X.I CVS.adm/Mod
  400. Xwill be listed instead.
  401. X.PP
  402. X.B GC
  403. X(Garbage Collection) collects garbage, dust & dead wood.  Should be called
  404. Xafter crashes while a
  405. X.IR CVS -program
  406. Xwas running, and other mishaps.
  407. XIt is up to the user to remove (or not!) the files
  408. X.I GC
  409. Xcomplains about.
  410. X.PP
  411. X.B "Saved versions."
  412. X.br
  413. XThe structure of a version, i.e., the revision numbers of its
  414. Xcomponent files, can be saved on a normal file, a
  415. X.I save-record;
  416. Xthe save-record can be used at another time to reconstruct the
  417. Xdescribed version.
  418. X.PP
  419. X.B SV
  420. X(Save Record)
  421. Xwrites a record about the present version (i.e. collection of
  422. Xrevisions) to standard output. This record can, at a later date, be
  423. Xfed to
  424. X.I RV,
  425. Xwhich will then restore the present version; this process
  426. Xrequires the repository again (or still) to be present, though not
  427. Xnecessarily with the same path name.
  428. X.I SV
  429. Xrequires the directory to be quiescent.
  430. X.PP
  431. X.B RV
  432. X(Restore Record) reads the recording made by
  433. X.I SV
  434. Xand restores the version described therein. The call is
  435. X.br
  436. X    RV
  437. X.I "repository-name save-record"
  438. X.br
  439. XThe repository has to exist, but
  440. X.I repository-name
  441. Xneeds not be the same as the one that pertained when
  442. X.I save-record
  443. Xwas made. The files will be
  444. Xreconstructed with the correct revision number, even if they have
  445. Xbeen removed by
  446. X.I RM
  447. Xand
  448. X.I CM
  449. Xin the meantime.
  450. X.PP
  451. XIf a save-record is kept of each distribution sent to a client, the
  452. Xfollowing scenario is useful when the client sends in some
  453. Xcorrections.  In an empty directory, call
  454. X.I RV
  455. Xto reconstruct the client's files.  Apply his corrections.  Call
  456. X.I UV
  457. Xto integrate them with your own innovations.  Call
  458. X.I DF
  459. Xand test, to see if they still make sense.  If satisfied, call
  460. X.I CM
  461. Xand remove the directory.
  462. X.PP
  463. X.B Subdirectories.
  464. X.br
  465. XSince there is no generally accepted structure for RCS directories
  466. Xwith subdirectories, the user is required to set up his own set of
  467. Xsubdirectories and to call
  468. X.I CV
  469. Xin each of them (note that the structure of the user directories
  470. Xneed not be the same as that of the RCS directories).  As long as
  471. Xhis directories form a tree,
  472. X.I UV
  473. Xin the top will update the whole tree.  A corresponding
  474. X.I CM,
  475. Xhowever, will
  476. X.B not
  477. Xcommit the whole tree; each directory will have to be committed
  478. Xseparately.
  479. X.PP
  480. X.B "Setting up"
  481. X.br
  482. XTo set up a repository
  483. X.I repos,
  484. Xmake an empty directory of that name, call
  485. X.I "CV repos,"
  486. Xdo
  487. X.I AE
  488. Xfor each file to go into the repository and finally call
  489. X.I CM
  490. Xto commit the initial version.
  491. X.PP
  492. XTo participate in an existing repository
  493. X.I repos,
  494. Xjust call
  495. X.I "CV repos".
  496. X.PP
  497. XTo turn an existing RCS directory into a repository, you can likewise call
  498. X.I "CV repos",
  499. Xsince no administration is kept in the RCS directory.
  500. XThis works even if both the user files and
  501. Xthe RCS directory already exist (this is useful if you want to start using
  502. X.I CVS
  503. Xfor an existing project).
  504. X.PP
  505. X.B Remarks.
  506. X.br
  507. XTo forcibly stop a running
  508. X.I UV
  509. Xor
  510. X.I CM,
  511. Xsend signal 15 to the top process (\fIkill \-15 <proc-num>\fP); after some
  512. Xseconds it will stop in a more or less reasonable state.
  513. X.PP
  514. XIf either has succumbed to a system crash, act as follows.
  515. XCall
  516. X.I GC
  517. Xand act on its messages until it shuts up.  You can
  518. Xunlock an RCS file that may have been left locked by calling
  519. X.I "rcs -u".
  520. XThen call
  521. X.I UV
  522. Xand act on its messages until it shuts up.  And then call
  523. X.I UV
  524. Xagain (this is necessary to get the time stamps right in some cases).
  525. X.PP
  526. XSince
  527. X.I CVS
  528. Xdoes not keep any information in the repository, it can coexist with
  529. Xother systems or users using raw RCS commands, provided that each
  530. Xalien user leaves the repository consistent.
  531. X.PP
  532. XIf the user version is quiescent (i.e.,
  533. X.I UV
  534. Xgives no output), the user can remove his files with impunity; a
  535. Xsubsequent call of
  536. X.I UV
  537. Xwill restore the full version.
  538. X.SH ENVIRONMENT
  539. X.IP RCSBIN 8
  540. XIf defined: the name of the directory where the RCS programs reside.
  541. XDefault: as determined in the
  542. X.I Makefile.
  543. X.IP CVSPATH 8
  544. XIf defined: the search path for non-RCS programs.  Default:
  545. X.I /bin:/usr/bin.
  546. X.SH FILES
  547. X.ta 30n
  548. X\&./CVS.adm/Repository    holds name of repository
  549. X.br
  550. X\&./CVS.adm/Files    list of file names in the version
  551. X.br
  552. X\&./CVS.adm/Entries    version number and time stamp for each file
  553. X.br
  554. X\&./CVS.adm/Entries.Backup
  555. X.br
  556. X\&./CVS.adm/Mod    names of files modified since last
  557. X.I CM
  558. X(or since
  559. X.IR CV )
  560. X.br
  561. X\&./*,[pt]    options and text for
  562. X.I AE
  563. X.br
  564. X\&Attic    attic for removed files, in the repository
  565. X.br
  566. X\&#cvs.*    multi-reader single-writer locks, in the repository
  567. X.br
  568. Xrcs, ci, co, rcsmerge, rlog    RCS programs
  569. X.SH SEE ALSO
  570. XRCS documentation; rcsintro(1)
  571. X.SH AUTHOR
  572. XDick Grune, Vrije Universiteit, Amsterdam
  573. X.SH DIAGNOSTICS
  574. XBoth
  575. X.I UV
  576. Xand
  577. X.I CM
  578. Xattempt first to make sure that all required actions are possible before
  579. Xdoing any of them.
  580. X.SH DISADVANTAGES
  581. XIf
  582. X.I N
  583. Xusers participate, there will be
  584. X.I N
  585. Xcopies on disk.
  586. X.br
  587. XIt's all shell files and slow.
  588. X.br
  589. X.SH BUGS
  590. XThere is not (yet) a way to work with branches.
  591. X.br
  592. XFunny file names (e.g. containing spaces or *) will give trouble.
  593. X.br
  594. XWeird things happen if the RCS programs cannot be found.
  595. X.br
  596. XDo not run two of the
  597. X.I CVS
  598. Xprograms simultaneously in the same user
  599. Xdirectory; there is no lock-out on the user directory, for
  600. Xefficiency reasons (though there is on the repository).
  601. + END-OF-FILE cvs.1
  602. chmod 'u=rw,g=r,o=r' \c\v\s\.\1
  603. set `sum \c\v\s\.\1`
  604. sum=$1
  605. case $sum in
  606. 33575)    :;;
  607. *)    echo 'Bad sum in '\c\v\s\.\1 >&2
  608. esac
  609. echo Extracting \A\E
  610. sed 's/^X//' > \A\E << '+ END-OF-FILE '\A\E
  611. X#!/bin/sh
  612. X#    This file is part of the Concurrent Versions System CVS.
  613. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  614. X#    $Header: AE,v 1.27 86/06/22 18:08:35 dick Exp $
  615. X
  616. X#
  617. X#        A d d   E n t r y
  618. X#    The call AE [ -... ] filename ... adds new entries to the
  619. X#    present version; the options -... will be passed on
  620. X#    to rcs -i (see RCS manual).  For each file it asks for a
  621. X#    description, in RCS fashion.
  622. X#    The entries will be added to the RCS repository upon the
  623. X#    next call of CM.
  624. X#    The user files must already exist.
  625. X#    AE on a file removed with RM will resurrect the file.
  626. X#
  627. XName=AE; export Name
  628. X
  629. X# CVSBIN, CVSLIB and RCSBIN directories
  630. XCVSBIN=/user1/dick/cvs
  631. XCVSLIB=/user1/dick/cvs
  632. XRCSBIN=${RCSBIN-/usr/new}
  633. Xexport CVSBIN CVSLIB RCSBIN
  634. X
  635. X# avoid spurious identifications
  636. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  637. X
  638. X# determine the name of the repository
  639. X. $CVSLIB/NR.aux
  640. X
  641. X# get possible options
  642. X. $CVSLIB/OP.aux            # sets $Options
  643. X
  644. Xcase $# in
  645. X0)
  646. X    echo Call is: $Name \<options\> filename ... \
  647. X                    to add files to present version >&2
  648. X    exit 1
  649. X    ;;
  650. Xesac
  651. X
  652. XOK=yes
  653. Xfor User in $@
  654. Xdo
  655. X    Rcs=$Repository/$User,v
  656. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  657. X    
  658. X    # what entry is this?
  659. X    case $VN_User in
  660. X    "")
  661. X        # no entry available, $TS_Rcs is invalid
  662. X        
  663. X        # how is the RCS file?
  664. X        case $VN_Rcs in
  665. X        "")
  666. X            # there is no RCS file either
  667. X            
  668. X            # how is the user file?
  669. X            case "$TS_User" in
  670. X            "")
  671. X                # there is no user file
  672. X                echo $Name: nothing known about $User >&2
  673. X                OK=no
  674. X                ;;
  675. X            *)
  676. X                # there is a user file
  677. X                . $CVSLIB/BE.aux    # build entry
  678. X                ;;
  679. X            esac
  680. X            ;;
  681. X        *)
  682. X            # there is an RCS file
  683. X            
  684. X            # illegal addition
  685. X            echo $Name: $User added independently \
  686. X                            by second party >&2
  687. X            OK=no
  688. X            ;;
  689. X        esac
  690. X        ;;
  691. X    
  692. X    0)
  693. X        # an entry for a new-born file, $TS_Rcs is dummy
  694. X        
  695. X        # but that is inappropriate here
  696. X        echo $Name: $User has already been entered >&2
  697. X        OK=no
  698. X        ;;
  699. X    
  700. X    -*)
  701. X        # an entry for a removed file, $TS_Rcs is valid
  702. X        
  703. X        # how is the user file?
  704. X        case "$TS_User" in
  705. X        "")
  706. X            # there is no user file (as it should be)
  707. X            
  708. X            # how is the RCS file?
  709. X            case -$VN_Rcs in
  710. X            -)
  711. X                # there is no RCS file
  712. X            
  713. X                # it has already been removed
  714. X                echo $Name: cannot resurrect $User, \
  715. X                    RCS file removed by second party >&2
  716. X                OK=no
  717. X                ;;
  718. X            *)
  719. X                # there is an RCS file
  720. X                
  721. X                # resurrection requested
  722. X                # remove initial minus from $VN_User
  723. X                VN_User=`expr $VN_User : '-\(.*\)' `
  724. X                $CVSLIB/RG.aux $User $VN_User \
  725. X                            "Resurrected $User"
  726. X                if    # we can restore the copy
  727. X                    $CVSBIN/UV $User
  728. X                then
  729. X                    echo $Name: $User, version $VN_User, \
  730. X                        resurrected >&2
  731. X                else
  732. X                    echo $Name: could not \
  733. X                            resurrect $User >&2
  734. X                    OK=no
  735. X                fi
  736. X                ;;
  737. X            esac
  738. X            ;;
  739. X        *)
  740. X            # user file shouldn't be there
  741. X            echo $Name: $User should be removed \
  742. X                and is still there >&2
  743. X            OK=no
  744. X            ;;
  745. X        esac
  746. X        ;;
  747. X    
  748. X    *)
  749. X        # a normal entry, $TS_Rcs is valid
  750. X        
  751. X        # illegal addition
  752. X        echo $Name: $User already exists, \
  753. X            with version number $VN_User >&2
  754. X        OK=no
  755. X        ;;
  756. X    esac
  757. Xdone
  758. X
  759. X$CVSLIB/EF.aux                # update CVS.adm/Files
  760. X
  761. X# did we succeed?
  762. Xcase $OK in
  763. Xno)
  764. X    exit 1
  765. X    ;;
  766. Xesac
  767. X
  768. Xexit 0
  769. + END-OF-FILE AE
  770. chmod 'u=rwx,g=rx,o=rx' \A\E
  771. set `sum \A\E`
  772. sum=$1
  773. case $sum in
  774. 54667)    :;;
  775. *)    echo 'Bad sum in '\A\E >&2
  776. esac
  777. echo Extracting \C\M
  778. sed 's/^X//' > \C\M << '+ END-OF-FILE '\C\M
  779. X#!/bin/sh
  780. X#    This file is part of the Concurrent Versions System CVS.
  781. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  782. X#    $Header: CM,v 1.41 86/06/22 18:09:47 dick Exp $
  783. X
  784. X#
  785. X#        C o m m i t
  786. X#    CM commits the present version to the RCS repository, AFTER
  787. X#    having done a test on conflicts.  The call is
  788. X#        CM [ -n ] 'log-message'
  789. X#    for a general commit, and
  790. X#        CM [ -n ] 'log-message' file ...
  791. X#    for a (dangerous) partial commit.
  792. X#
  793. X#    If the present directory contains subdirectories that hold
  794. X#    concurrent versions, these are NOT committed too.  (See, however, UV.)
  795. X#
  796. X#    The -n option restricts the actions to reporting only.
  797. X#
  798. XName=CM; export Name
  799. X
  800. X# CVSBIN, CVSLIB and RCSBIN directories
  801. XCVSBIN=/user1/dick/cvs
  802. XCVSLIB=/user1/dick/cvs
  803. XRCSBIN=${RCSBIN-/usr/new}
  804. Xexport CVSBIN CVSLIB RCSBIN
  805. X
  806. X# avoid spurious identifications
  807. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  808. X
  809. X# determine the name of the repository
  810. X. $CVSLIB/NR.aux
  811. X
  812. X# to ACT or not to ACT, that is the question
  813. Xcase "$1" in
  814. X-n)
  815. X    ACT=echo
  816. X    shift
  817. X    ;;
  818. X*)
  819. X    ACT=
  820. X    ;;
  821. Xesac
  822. X
  823. XMessage="$1"
  824. Xif    # there was no message
  825. X    [ "$Message" = "" ] \
  826. X||    # it was a file name
  827. X    [ -r "$Message" ]
  828. Xthen
  829. X    echo $Name: no modification message! >&2
  830. X    exit 1
  831. Xfi
  832. Xshift
  833. X
  834. X#    A T T E M P T   E X C L U S I V E   W R I T E   A C C E S S
  835. X
  836. XLDR=$Repository                # the directory
  837. XLCK=$LDR/\#cvs.lock            # the lock
  838. XTFL=$LDR/\#cvs.tfl            # a temporary test file
  839. XRFL=$LDR/\#cvs.rfl            # pattern of the read flags
  840. XWFL=$LDR/\#cvs.wfl            # the general write flag
  841. X
  842. X# attempt write access at all
  843. Xif    # we can write at all
  844. X    cp /dev/null $TFL >/dev/null 2>/dev/null
  845. Xthen    # okay so far
  846. X    rm $TFL
  847. Xelse    # not so okay
  848. X    echo $Name: you have no write permission in $LDR >&2
  849. X    exit 1
  850. Xfi
  851. X
  852. X# set lock
  853. X. $CVSLIB/SL.aux            # persistently tries to mkdir $LCK
  854. X
  855. X# set trap to remove flag and lock on interrupt and exit
  856. Xtrap 'rm -f $WFL; rmdir $LCK; exit' 0 1 2 3 15
  857. X
  858. X#    C R I T I C A L   S E C T I O N
  859. X
  860. X# notify others of intention
  861. Xcp /dev/null $WFL            # plant write flag
  862. X
  863. X# wait for the readers to disappear
  864. Xwhile    # there are still read flags
  865. X    [ "`echo $RFL.* | grep -v '\*'`" != "" ]
  866. Xdo
  867. X    echo $Name: `date`: waiting for readers to disappear
  868. X    sleep 60
  869. Xdone
  870. X
  871. X#    W R I T E   I N   S A F E T Y
  872. X
  873. X# determine the way we are called
  874. Xcase $# in
  875. X0)
  876. X    # no file names: treat all pertinent files
  877. X    set "`$CVSLIB/FN.aux $Repository`"
  878. X    $ACT cp /dev/null CVS.adm/Mod
  879. X    ;;
  880. Xesac
  881. X
  882. X# collect the sets of affected files
  883. X
  884. XOK=yes
  885. X. $CVSLIB/CS.aux    # sets CLIST, GLIST, MLIST, OLIST, ALIST, RLIST, WLIST
  886. X
  887. Xcase $OK in
  888. Xno)
  889. X    # this checks for CLIST as well, since CLIST != "" <-> OK=no
  890. X    exit 1
  891. Xesac
  892. X
  893. X# everything up to date?
  894. Xcase "$GLIST$OLIST$WLIST" in
  895. X"")
  896. X    ;;
  897. X*)
  898. X    echo $Name: the following files are not up to date\; use UV first >&2
  899. X    echo $GLIST$OLIST$WLIST >&2
  900. X    exit 1
  901. X    ;;
  902. Xesac
  903. X
  904. X# is there anything to do in the first place?
  905. Xcase "$MLIST$RLIST$ALIST" in
  906. X"")
  907. X    echo $Name: there is nothing to commit! >&2
  908. X    exit 1
  909. X    ;;
  910. Xesac
  911. X
  912. X# try to get exclusive control of all files to be affected
  913. XOK=yes
  914. Xfor User in $MLIST $RLIST
  915. Xdo
  916. X    Rcs=$Repository/$User,v
  917. X        
  918. X    if    # we can lock $Rcs
  919. X        $ACT $RCSBIN/rcs -q -l $Rcs
  920. X    then    # add it to the list LLIST
  921. X        LLIST="$LLIST $User"
  922. X    else
  923. X        echo $Name: could not lock $Rcs >&2
  924. X        OK=no
  925. X    fi
  926. Xdone
  927. X
  928. X# try to create all files in the add list
  929. Xfor User in $ALIST
  930. Xdo
  931. X    Rcs=$Repository/$User,v
  932. X    
  933. X    if    # create $Rcs, using the description files $User,[pt]
  934. X        $ACT $RCSBIN/rcs -i `cat $User,p` -t$User,t $Rcs
  935. X    then    :
  936. X    else    # something is wrong
  937. X        echo $Name: could not create $Rcs >&2
  938. X        OK=no
  939. X    fi
  940. Xdone
  941. X
  942. X# did we succeed?
  943. Xcase $OK in
  944. Xno)
  945. X    # something failed; release all locked files & remove all added files
  946. X    for User in $LLIST
  947. X    do    # unlock the RCS file
  948. X        Rcs=$Repository/$User,v
  949. X        if    # unlock $Rcs
  950. X            $ACT $RCSBIN/rcs -q -u $Rcs
  951. X        then    :
  952. X        else    # something very wrong
  953. X            echo $Name: could not UNlock $Rcs >&2
  954. X        fi
  955. X    done
  956. X    
  957. X    for User in $ALIST
  958. X    do    # remove the newly created RCS file
  959. X        Rcs=$Repository/$User,v
  960. X        $ACT rm -f $Rcs
  961. X    done
  962. X    
  963. X    # and give up
  964. X    exit 1
  965. X    ;;
  966. Xesac
  967. X
  968. X# got them all; now go ahead!
  969. X
  970. X# add the files in the ALIST
  971. X
  972. X# get revision level
  973. XRevision=-r`
  974. X    <CVS.adm/Entries sed 's/[.|].*//' |
  975. X    sort -nr |
  976. X    sed '1q'
  977. X`
  978. Xif    # there are initial entries only
  979. X    [ X$Revision = X-r0 ]
  980. Xthen    # make it level 1
  981. X    Revision=-r1
  982. Xfi
  983. X
  984. Xfor User in $ALIST            # with $Revision set
  985. Xdo
  986. X    . $CVSLIB/CI.aux        # a careful check-in; may set OK=no
  987. X    $ACT rm -f $User,[pt]        # throw away the info files from AE
  988. Xdone
  989. X
  990. X# modify the files in the MLIST
  991. XRevision=""
  992. Xfor User in $MLIST            # with $Revision empty
  993. Xdo
  994. X    . $CVSLIB/CI.aux        # a careful check-in; may set OK=no
  995. Xdone
  996. X
  997. X# remove the RCS files in the RLIST
  998. Xfor User in $RLIST
  999. Xdo
  1000. X    Rcs=$Repository/$User,v
  1001. X    Old=$Repository/Attic/$User,v
  1002. X    
  1003. X    $ACT mkdir $Repository/Attic >/dev/null 2>/dev/null
  1004. X    if    # we could move RCS file away
  1005. X        (    # we can unlock $Rcs
  1006. X            $ACT $RCSBIN/rcs -u -q $Rcs \
  1007. X        &&    # we can move it away
  1008. X            $ACT mv $Rcs $Old
  1009. X        ) \
  1010. X    ||    # the file was already removed
  1011. X        ( [ ! -r $Rcs -a -r $Old ] )
  1012. X    then    # scratch the entry as well
  1013. X        $ACT $CVSLIB/SC.aux $User
  1014. X    else
  1015. X        echo $Name: attempt to move $Rcs to $Old failed >&2
  1016. X        OK=no
  1017. X    fi
  1018. Xdone
  1019. X
  1020. X# did we succeed?
  1021. Xcase $OK in
  1022. Xno)
  1023. X    exit 1
  1024. X    ;;
  1025. Xesac
  1026. X
  1027. Xexit 0
  1028. + END-OF-FILE CM
  1029. chmod 'u=rwx,g=rx,o=rx' \C\M
  1030. set `sum \C\M`
  1031. sum=$1
  1032. case $sum in
  1033. 13212)    :;;
  1034. *)    echo 'Bad sum in '\C\M >&2
  1035. esac
  1036. echo Extracting \C\V
  1037. sed 's/^X//' > \C\V << '+ END-OF-FILE '\C\V
  1038. X#!/bin/sh
  1039. X#    This file is part of the Concurrent Versions System CVS.
  1040. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1041. X#    $Header: CV,v 1.19 86/06/22 18:10:31 dick Exp $
  1042. X
  1043. X#
  1044. X#        C r e a t e   V e r s i o n
  1045. X#    CV creates a "version" of an RCS repository.  This version
  1046. X#    is owned totally by the user and is actually an independent
  1047. X#    copy, to be dealt with as seen fit.  Once CV has been called
  1048. X#    in a given directory, it never needs to be called again.  The
  1049. X#    user can keep up-to-date by calling UV when he feels like it;
  1050. X#    this will supply him with a merge of his own modifications
  1051. X#    and the changes made in the RCS original.  See UV for details.
  1052. X#
  1053. X#    When the user is satisfied with his own modifications, the
  1054. X#    present version can be committed by CM; this keeps the present
  1055. X#    version in tact.
  1056. X#
  1057. X#    The call is
  1058. X#        CV <repository-name>
  1059. X#    with preferably the full path name of the RCS repository.
  1060. X#    CV will then make the initial copy (at rcs speed).
  1061. X#
  1062. X#    CV creates a directory ./CVS.adm, in which it keeps its
  1063. X#    administration, in two files, Repository and Entries.
  1064. X#    The first contains the name of the repository.  The second
  1065. X#    contains one line for each registered file,
  1066. X#    consisting of the version number it derives from,
  1067. X#    its time stamp at derivation time and its name.  Both files
  1068. X#    are normal files and can be edited by the user, if necessary (when
  1069. X#    the repository is moved, e.g.)
  1070. X#
  1071. XName=CV; export Name
  1072. X
  1073. X# CVSBIN, CVSLIB and RCSBIN directories
  1074. XCVSBIN=/user1/dick/cvs
  1075. XCVSLIB=/user1/dick/cvs
  1076. XRCSBIN=${RCSBIN-/usr/new}
  1077. Xexport CVSBIN CVSLIB RCSBIN
  1078. X
  1079. X# avoid spurious identifications
  1080. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1081. X
  1082. X# is the call correct?
  1083. Xcase $# in
  1084. X1)
  1085. X    # the number of parameters is alright; prepare for CA.aux
  1086. X    Repository=$1
  1087. X    InitRecord=/dev/null
  1088. X    ;;
  1089. X*)
  1090. X    echo $Name: call is $Name \<repository-name\> >&2
  1091. X    exit 1
  1092. X    ;;
  1093. Xesac
  1094. X
  1095. X# create the administration directory
  1096. X. $CVSLIB/CA.aux            # uses $Repository and $InitRecord
  1097. X
  1098. X# make dummy entries for files already present, for UV to work on
  1099. Xfor User in `$CVSLIB/FN.aux $Repository`
  1100. Xdo
  1101. X    Rcs=$Repository/$User,v
  1102. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1103. X    
  1104. X    case "$TS_User" in
  1105. X    "")
  1106. X        # no problem
  1107. X        ;;
  1108. X    *)
  1109. X        # the file is already there, we acknowledge its presence
  1110. X        $CVSLIB/RG.aux $User $VN_Rcs "Initial $User"
  1111. X        ;;
  1112. X    esac
  1113. Xdone
  1114. X
  1115. X# call UV
  1116. X$CVSBIN/UV
  1117. + END-OF-FILE CV
  1118. chmod 'u=rwx,g=rx,o=rx' \C\V
  1119. set `sum \C\V`
  1120. sum=$1
  1121. case $sum in
  1122. 53592)    :;;
  1123. *)    echo 'Bad sum in '\C\V >&2
  1124. esac
  1125. echo Extracting \D\F
  1126. sed 's/^X//' > \D\F << '+ END-OF-FILE '\D\F
  1127. X#!/bin/sh
  1128. X#    This file is part of the Concurrent Versions System CVS.
  1129. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1130. X#    $Header: DF,v 1.22 86/06/22 18:11:14 dick Exp $
  1131. X
  1132. X#
  1133. X#        D i f f e r e n c e
  1134. X#    Does a nice form of diff(1) on each of its arguments and the
  1135. X#    RCS file it derives from.
  1136. X#    The call is
  1137. X#        DF <options> [ file-name ... ]
  1138. X#    If there are <options>, these are passed to diff(1) and the diff
  1139. X#    format is adhered to; otherwise a more readable format is produced.
  1140. X#    Standard diff(1) format can also be forced by a single -.
  1141. X#    If there are no file names, the names of the interesting files
  1142. X#    are taken from CVS.adm/Mod.  If the option is -n, diff(1) will not
  1143. X#    be called, but the contents of CVS.adm/Mod will be listed instead.
  1144. X#
  1145. XName=DF; export Name
  1146. X
  1147. X# CVSBIN, CVSLIB and RCSBIN directories
  1148. XCVSBIN=/user1/dick/cvs
  1149. XCVSLIB=/user1/dick/cvs
  1150. XRCSBIN=${RCSBIN-/usr/new}
  1151. Xexport CVSBIN CVSLIB RCSBIN
  1152. X
  1153. X# avoid spurious identifications
  1154. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1155. X
  1156. X# determine the name of the repository
  1157. X. $CVSLIB/NR.aux
  1158. X
  1159. X# get possible options
  1160. X. $CVSLIB/OP.aux            # sets $Options
  1161. X
  1162. X# special cases
  1163. Xcase "$Options" in
  1164. X" -")
  1165. X    # single -, just plain old diff
  1166. X    Options=" "
  1167. X    ;;
  1168. X" -n")
  1169. X    # no diff at all, just show contents of CVS.adm/Mod
  1170. X    cat CVS.adm/Mod
  1171. X    exit 0
  1172. X    ;;
  1173. Xesac
  1174. X
  1175. X# determine the way we are called
  1176. Xcase $# in
  1177. X0)
  1178. X    # no file names: read CVS.adm/Mod
  1179. X    if    # CVS.adm/Mod is empty
  1180. X        [ ! -s CVS.adm/Mod ]
  1181. X    then
  1182. X        echo $Name: no modifications to report
  1183. X        exit 0
  1184. X    fi
  1185. X    set `cat CVS.adm/Mod`
  1186. X    ;;
  1187. Xesac
  1188. X
  1189. Xfor User in $@
  1190. Xdo
  1191. X    . $CVSLIB/LR.aux    # sets $Rcs to $Repository/$User,v or /Attic/
  1192. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1193. X    
  1194. X    # what entry is this?
  1195. X    case $VN_User in
  1196. X    "")
  1197. X        # no entry available, $TS_Rcs is invalid
  1198. X        
  1199. X        echo $Name: I know nothing about $User >&2
  1200. X        continue
  1201. X        ;;
  1202. X    
  1203. X    0)
  1204. X        # an entry for a new-born file, $TS_Rcs is dummy
  1205. X        
  1206. X        echo $Name: $User is a new entry, no comparison available >&2
  1207. X        continue
  1208. X        ;;
  1209. X    
  1210. X    -*)
  1211. X        # an entry for a removed file, $TS_Rcs is valid
  1212. X        
  1213. X        echo $Name: $User was removed, no comparison available >&2
  1214. X        continue
  1215. X        ;;
  1216. X    
  1217. X    *)
  1218. X        # a normal entry, $TS_Rcs is valid
  1219. X        
  1220. X        # how is the RCS file?
  1221. X        case $VN_Rcs in
  1222. X        "")
  1223. X            # there is no RCS file
  1224. X            
  1225. X            echo $Name: cannot find $Rcs >&2
  1226. X            continue
  1227. X            ;;
  1228. X        *)
  1229. X            # there is an RCS file
  1230. X            
  1231. X            # how is the user file?
  1232. X            case "$TS_User" in
  1233. X            "")
  1234. X                # there is no user file
  1235. X                echo $Name: cannot find $User >&2
  1236. X                continue
  1237. X                ;;
  1238. X            esac
  1239. X            ;;
  1240. X        esac
  1241. X        ;;
  1242. X    esac
  1243. X
  1244. X    echo FILE $User VERSUS $Rcs, version $VN_User
  1245. X    $RCSBIN/co -p -q -r$VN_User $Rcs |
  1246. X    diff $Options $User - |
  1247. X    case "$Options" in
  1248. X    "")
  1249. X        # nothing special, user seems to like my taste in diffs
  1250. X        sed '
  1251. X            s/^[1-9][0-9]*/&/
  1252. X            s/.*//
  1253. X            s/^[1-9]/\
  1254. XAT &/
  1255. X            s/^> /WAS:    /
  1256. X            s/^< /NEW:    /
  1257. X        '
  1258. X        ;;
  1259. X    *)
  1260. X        # have it you own way
  1261. X        cat
  1262. X        ;;
  1263. X    esac
  1264. X    echo ''
  1265. X
  1266. Xdone
  1267. + END-OF-FILE DF
  1268. chmod 'u=rwx,g=rx,o=rx' \D\F
  1269. set `sum \D\F`
  1270. sum=$1
  1271. case $sum in
  1272. 25951)    :;;
  1273. *)    echo 'Bad sum in '\D\F >&2
  1274. esac
  1275. echo Extracting \G\C
  1276. sed 's/^X//' > \G\C << '+ END-OF-FILE '\G\C
  1277. X#!/bin/sh
  1278. X#    This file is part of the Concurrent Versions System CVS.
  1279. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1280. X#    $Header: GC,v 1.25 86/06/22 18:11:33 dick Exp $
  1281. X
  1282. X#
  1283. X#        G a r b a g e   C o l l e c t i o n
  1284. X#    Collects garbage, dust & dead wood.  Should be called after
  1285. X#    crashes while a CVS-program was running, and other mishaps.
  1286. X#
  1287. XName=GC; export Name
  1288. X
  1289. X# CVSBIN, CVSLIB and RCSBIN directories
  1290. XCVSBIN=/user1/dick/cvs
  1291. XCVSLIB=/user1/dick/cvs
  1292. XRCSBIN=${RCSBIN-/usr/new}
  1293. Xexport CVSBIN CVSLIB RCSBIN
  1294. X
  1295. X# avoid spurious identifications
  1296. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1297. X
  1298. X# determine the name of the repository
  1299. X. $CVSLIB/NR.aux
  1300. X
  1301. XTmp1=CVS.adm/GC.1
  1302. XTmp2=CVS.adm/GC.2
  1303. X
  1304. X# are there duplicates in the CVS.adm/Entries file?
  1305. Xcat CVS.adm/Entries |
  1306. Xsed 's/.* \(.*\)|/\1/' |
  1307. Xsort |
  1308. Xuniq -c |
  1309. Xgrep -v ' 1 ' >$Tmp1
  1310. Xif    # this yielded something
  1311. X    [ -s $Tmp1 ]
  1312. Xthen    # report
  1313. X    echo $Name: duplicates in CVS.adm/Entries:
  1314. X    cat $Tmp1
  1315. Xfi
  1316. X
  1317. X# try to find garbage in CVS.adm
  1318. Xls CVS.adm |
  1319. Xsed '
  1320. X    /^Entries$/d
  1321. X    /^Entries.Backup$/d
  1322. X    /^Files$/d
  1323. X    /^Mod$/d
  1324. X    /^Repository$/d
  1325. X    /^GC.[12]$/d
  1326. X' >$Tmp1
  1327. Xif    # this yielded something
  1328. X    [ -s $Tmp1 ]
  1329. Xthen    # report
  1330. X    echo $Name: garbage in directory CVS.adm:
  1331. X    cat $Tmp1 |
  1332. X    sed 's/^/    CVS.adm\//'
  1333. X    echo ''
  1334. Xfi
  1335. X
  1336. X# try to find locked files in the repository
  1337. X(
  1338. X    cd $Repository
  1339. X    $RCSBIN/rlog -Lh *,v
  1340. X)
  1341. X
  1342. X# try to find garbage left-over by RCS
  1343. Xls -d ,* $Repository/,* |
  1344. Xsed '
  1345. X    /not found/d
  1346. X' >$Tmp1
  1347. Xif    # this yielded something
  1348. X    [ -s $Tmp1 ]
  1349. Xthen    # report
  1350. X    echo $Name: RCS left-overs found:
  1351. X    cat $Tmp1 |
  1352. X    sed 's/^/    /'
  1353. X    echo ''
  1354. Xfi
  1355. X
  1356. X# try to find left-over locks & flags
  1357. Xecho $Repository/\#cvs.* |
  1358. Xgrep -v '\*' >$Tmp1
  1359. Xif    # this yielded something
  1360. X    [ -s $Tmp1 ]
  1361. Xthen    # such garbage exists
  1362. X    echo $Name: left-over flags and locks found:
  1363. X    cat $Tmp1 |
  1364. X    sed 's/^/    /'
  1365. X    echo ''
  1366. Xfi
  1367. X
  1368. Xrm -f $Tmp1 $Tmp2
  1369. + END-OF-FILE GC
  1370. chmod 'u=rwx,g=rx,o=rx' \G\C
  1371. set `sum \G\C`
  1372. sum=$1
  1373. case $sum in
  1374. 55596)    :;;
  1375. *)    echo 'Bad sum in '\G\C >&2
  1376. esac
  1377. echo Extracting \L\S
  1378. sed 's/^X//' > \L\S << '+ END-OF-FILE '\L\S
  1379. X#!/bin/sh
  1380. X#    This file is part of the Concurrent Versions System CVS.
  1381. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1382. X#    $Header: LS,v 1.20 86/06/22 18:12:16 dick Exp $
  1383. X
  1384. X#
  1385. X#        L i s t   i n f o r m a t i o n
  1386. X#    Prints three lines of information for each of its arguments,
  1387. X#    one for the user file (line 1), one for the newest RCS file
  1388. X#    (line 3) and one for the RCS file both derive from (line 2).
  1389. X#
  1390. XName=LS; export Name
  1391. X
  1392. X# CVSBIN, CVSLIB and RCSBIN directories
  1393. XCVSBIN=/user1/dick/cvs
  1394. XCVSLIB=/user1/dick/cvs
  1395. XRCSBIN=${RCSBIN-/usr/new}
  1396. Xexport CVSBIN CVSLIB RCSBIN
  1397. X
  1398. X# avoid spurious identifications
  1399. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1400. X
  1401. X# determine the name of the repository
  1402. X. $CVSLIB/NR.aux
  1403. X
  1404. Xfor User in $@
  1405. Xdo
  1406. X    . $CVSLIB/LR.aux    # sets $Rcs to $Repository/$User,v or /Attic/
  1407. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1408. X    
  1409. X    case "$TS_User" in
  1410. X    "")
  1411. X        echo "User:    no user file $User"
  1412. X        ;;
  1413. X    *)
  1414. X        echo "User:        $TS_User"
  1415. X        ;;
  1416. X    esac
  1417. X    
  1418. X    case $VN_User in
  1419. X    "")
  1420. X        echo "From:    no entry for $User"
  1421. X        ;;
  1422. X    0)
  1423. X        # a new file
  1424. X        echo "From:    new    message: `<$User,t sed '1!d'`"
  1425. X        ;;
  1426. X    *)
  1427. X        echo "From:    $VN_User    $TS_Rcs"
  1428. X        ;;
  1429. X    esac
  1430. X    
  1431. X    case $VN_Rcs in
  1432. X    "")
  1433. X        echo "RCS:    no $Rcs"
  1434. X        ;;
  1435. X    *)
  1436. X        echo "RCS:    $VN_Rcs    $Rcs"
  1437. X        ;;
  1438. X    esac
  1439. X    echo ''
  1440. Xdone
  1441. + END-OF-FILE LS
  1442. chmod 'u=rwx,g=rx,o=rx' \L\S
  1443. set `sum \L\S`
  1444. sum=$1
  1445. case $sum in
  1446. 63035)    :;;
  1447. *)    echo 'Bad sum in '\L\S >&2
  1448. esac
  1449. echo Extracting \R\M
  1450. sed 's/^X//' > \R\M << '+ END-OF-FILE '\R\M
  1451. X#!/bin/sh
  1452. X#    This file is part of the Concurrent Versions System CVS.
  1453. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1454. X#    $Header: RM,v 1.15 86/06/22 18:13:33 dick Exp $
  1455. X
  1456. X#
  1457. X#        R e m o v e   E n t r y
  1458. X#    RM filename ... : removes entries from the present version.
  1459. X#    The entries will be removed from the RCS repository upon the
  1460. X#    next CM.
  1461. X#
  1462. XName=RM; export Name
  1463. X
  1464. X# CVSBIN, CVSLIB and RCSBIN directories
  1465. XCVSBIN=/user1/dick/cvs
  1466. XCVSLIB=/user1/dick/cvs
  1467. XRCSBIN=${RCSBIN-/usr/new}
  1468. Xexport CVSBIN CVSLIB RCSBIN
  1469. X
  1470. X# avoid spurious identifications
  1471. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1472. X
  1473. X# determine the name of the repository
  1474. X. $CVSLIB/NR.aux
  1475. X
  1476. Xcase $# in
  1477. X0)
  1478. X    echo Call is: $Name filename ... \
  1479. X                to remove files from present version >&2
  1480. X    exit 1
  1481. X    ;;
  1482. Xesac
  1483. X
  1484. XOK=yes
  1485. Xfor User in $@
  1486. Xdo
  1487. X    Rcs=$Repository/$User,v
  1488. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1489. X    
  1490. X    # $User may still exist
  1491. X    case "$TS_User" in
  1492. X    "")
  1493. X        ;;
  1494. X    *)
  1495. X        echo $Name: $User still exists >&2
  1496. X        OK=no
  1497. X        continue
  1498. X        ;;
  1499. X    esac
  1500. X    
  1501. X    # check its status
  1502. X    case $VN_User in
  1503. X    "")
  1504. X        echo $Name: there is no entry for $User >&2
  1505. X        OK=no
  1506. X        ;;
  1507. X    0)
  1508. X        # killed in the cradle
  1509. X        $CVSLIB/SC.aux $User
  1510. X        rm -f $User,?
  1511. X        ;;
  1512. X    -*)
  1513. X        echo $Name: $User was already removed >&2
  1514. X        OK=no
  1515. X        ;;
  1516. X    *)
  1517. X        # a full-grown entry; set it to removed
  1518. X        $CVSLIB/RG.aux $User -$VN_User "$TS_Rcs"
  1519. X        ;;
  1520. X    esac
  1521. Xdone
  1522. X
  1523. X$CVSLIB/EF.aux                # update CVS.adm/Files
  1524. X
  1525. X# did we succeed?
  1526. Xcase $OK in
  1527. Xno)
  1528. X    exit 1
  1529. X    ;;
  1530. Xesac
  1531. X
  1532. Xexit 0
  1533. + END-OF-FILE RM
  1534. chmod 'u=rwx,g=rx,o=rx' \R\M
  1535. set `sum \R\M`
  1536. sum=$1
  1537. case $sum in
  1538. 14142)    :;;
  1539. *)    echo 'Bad sum in '\R\M >&2
  1540. esac
  1541. echo Extracting \R\V
  1542. sed 's/^X//' > \R\V << '+ END-OF-FILE '\R\V
  1543. X#!/bin/sh
  1544. X#    This file is part of the Concurrent Versions System CVS.
  1545. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1546. X#    $Header: RV,v 1.10 86/06/22 18:13:52 dick Exp $
  1547. X
  1548. X#
  1549. X#        R e s t o r e   V e r s i o n
  1550. X#    RV reads the recording made by SV and restores the version described
  1551. X#    therein. The call is
  1552. X#        RV <repository-name> <SV-record>
  1553. X#    The repository has to exist, but <repository-name> needs not be the
  1554. X#    same as the one that pertained when SV was done. The files will be
  1555. X#    reconstructed with the correct revision number, even if they have
  1556. X#    been removed by RM in the meantime.
  1557. XName=RV; export Name
  1558. X
  1559. X# CVSBIN, CVSLIB and RCSBIN directories
  1560. XCVSBIN=/user1/dick/cvs
  1561. XCVSLIB=/user1/dick/cvs
  1562. XRCSBIN=${RCSBIN-/usr/new}
  1563. Xexport CVSBIN CVSLIB RCSBIN
  1564. X
  1565. X# avoid spurious identifications
  1566. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1567. X
  1568. X# is the call correct?
  1569. Xcase $# in
  1570. X2)
  1571. X    # the number of parameters is alright; register them for CA.aux
  1572. X    Repository=$1
  1573. X    InitRecord=$2
  1574. X    ;;
  1575. X*)
  1576. X    # wrong number of parameters
  1577. X    echo $Name: call is $Name \<repository-name\> \<SV-record\> >&2
  1578. X    exit 1
  1579. X    ;;
  1580. Xesac
  1581. X
  1582. X# create the administration directory
  1583. X. $CVSLIB/CA.aux            # uses $Repository and $InitRecord
  1584. X
  1585. X# construct list of files to check out
  1586. XOLIST=` <CVS.adm/Entries sed 's/.* \(.*\)|/\1/' `
  1587. X
  1588. X# see if any is already present
  1589. XOK=yes
  1590. Xfor User in $OLIST
  1591. Xdo
  1592. X    if    # there is a file $User already
  1593. X        [ -f $User ]
  1594. X    then
  1595. X        echo $Name: $User already exists >&2
  1596. X        OK=no
  1597. X    fi
  1598. Xdone
  1599. X
  1600. Xcase $OK in
  1601. Xno)
  1602. X    echo $Name failed\; correct above errors first >&2
  1603. X    exit 1
  1604. X    ;;
  1605. Xesac
  1606. X
  1607. X# check out all files in $OLIST
  1608. Xfor User in $OLIST
  1609. Xdo
  1610. X    . $CVSLIB/LR.aux    # sets $Rcs to $Repository/$User,v or /Attic/
  1611. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1612. X    
  1613. X    # how is the RCS file?
  1614. X    case $VN_Rcs in
  1615. X    "")
  1616. X        # there is no RCS file
  1617. X        
  1618. X        echo $Name: cannot find $Rcs >&2
  1619. X        OK=no
  1620. X        continue
  1621. X        ;;
  1622. X    *)
  1623. X        # there is an RCS file
  1624. X        
  1625. X        if    # check out correct version of $Rcs into $User
  1626. X            $RCSBIN/co -r$VN_User $Rcs $User
  1627. X        then    # adjust $User
  1628. X            chmod +w $User
  1629. X            # make a reference with the NEW time stamp
  1630. X            # and the OLD version number
  1631. X            . $CVSLIB/VT.aux
  1632. X            $CVSLIB/RG.aux $User $VN_User "$TS_User"
  1633. X        else
  1634. X            echo $Name: could not check out $User >&2
  1635. X            OK=no
  1636. X        fi
  1637. X        ;;
  1638. X    esac
  1639. Xdone
  1640. X
  1641. X$CVSLIB/EF.aux                # update CVS.adm/Files
  1642. X
  1643. X# did we succeed?
  1644. Xcase $OK in
  1645. Xno)
  1646. X    exit 1
  1647. X    ;;
  1648. Xesac
  1649. X
  1650. Xexit 0
  1651. + END-OF-FILE RV
  1652. chmod 'u=rwx,g=rx,o=rx' \R\V
  1653. set `sum \R\V`
  1654. sum=$1
  1655. case $sum in
  1656. 36697)    :;;
  1657. *)    echo 'Bad sum in '\R\V >&2
  1658. esac
  1659. echo Extracting \S\V
  1660. sed 's/^X//' > \S\V << '+ END-OF-FILE '\S\V
  1661. X#!/bin/sh
  1662. X#    This file is part of the Concurrent Versions System CVS.
  1663. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1664. X#    $Header: SV,v 1.6 86/06/22 18:14:30 dick Exp $
  1665. X
  1666. X#
  1667. X#        S a v e   V e r s i o n
  1668. X#    SV writes a record about the present version (i.e. collection of
  1669. X#    revisions) to standard output. This record can, at a later date, be
  1670. X#    fed to RV, which will then restore the present version; this process
  1671. X#    requires the repository again (or still) to be present, though not
  1672. X#    necessarily with the same path name.
  1673. X#
  1674. X#    SV requires the directory to be quiescent.
  1675. X#
  1676. XName=SV; export Name
  1677. X
  1678. X# CVSBIN, CVSLIB and RCSBIN directories
  1679. XCVSBIN=/user1/dick/cvs
  1680. XCVSLIB=/user1/dick/cvs
  1681. XRCSBIN=${RCSBIN-/usr/new}
  1682. Xexport CVSBIN CVSLIB RCSBIN
  1683. X
  1684. X# avoid spurious identifications
  1685. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1686. X
  1687. X# determine the name of the repository
  1688. X. $CVSLIB/NR.aux
  1689. X
  1690. X# determine the way we are called
  1691. Xcase $# in
  1692. X0)
  1693. X    # treat all pertinent files
  1694. X    set "`$CVSLIB/FN.aux $Repository`"
  1695. X    ;;
  1696. X*)
  1697. X    echo $Name: call is $Name \>save.record >&2
  1698. X    exit 1
  1699. X    ;;
  1700. Xesac
  1701. X
  1702. X# collect the sets of affected files
  1703. X
  1704. XOK=yes
  1705. X. $CVSLIB/CS.aux    # sets CLIST, GLIST, MLIST, OLIST, ALIST, RLIST, WLIST
  1706. X
  1707. Xcase $OK in
  1708. Xno)
  1709. X    echo $Name failed\; correct above errors first >&2
  1710. X    exit 1
  1711. Xesac
  1712. X
  1713. X# is the directory quiescent?
  1714. Xcase "$CLIST$GLIST$MLIST$OLIST$ALIST$RLIST$WLIST" in
  1715. X"")
  1716. X    ;;
  1717. X*)
  1718. X    echo $Name: the following files are not up to date: >&2
  1719. X    echo "$CLIST$GLIST$MLIST$OLIST$ALIST$RLIST$WLIST" >&2
  1720. X    exit 1
  1721. X    ;;
  1722. Xesac
  1723. X
  1724. X# now it is easy:
  1725. Xcat CVS.adm/Entries
  1726. X
  1727. Xexit 0
  1728. + END-OF-FILE SV
  1729. chmod 'u=rwx,g=rx,o=rx' \S\V
  1730. set `sum \S\V`
  1731. sum=$1
  1732. case $sum in
  1733. 01288)    :;;
  1734. *)    echo 'Bad sum in '\S\V >&2
  1735. esac
  1736. echo Extracting \U\V
  1737. sed 's/^X//' > \U\V << '+ END-OF-FILE '\U\V
  1738. X#!/bin/sh
  1739. X#    This file is part of the Concurrent Versions System CVS.
  1740. X#    Written by Dick Grune, Vrije Universiteit, Amsterdam.
  1741. X#    $Header: UV,v 1.31 86/06/22 18:14:46 dick Exp $
  1742. X
  1743. X#
  1744. X#        U p d a t e   V e r s i o n
  1745. X#    UV updates the version in the present directory with respect to
  1746. X#    the RCS repository.  The present version must have been created by CV.
  1747. X#    The user can keep up-to-date by calling UV whenever he feels like it.
  1748. X#    The present version can be committed by CM, but this keeps the
  1749. X#    version in tact.
  1750. X#
  1751. X#    The call is
  1752. X#        UV [ -n ]
  1753. X#    for a general update, or
  1754. X#        UV [ -n ] file ...
  1755. X#    for a partial update.
  1756. X#
  1757. X#    Modified or non-existent RCS files are checked out.
  1758. X#    Modified user files are reported as M <user_file>.  If both the
  1759. X#    RCS file and the user file have been modified, the user file
  1760. X#    is replaced by the result of rcsmerge.  If this throws up
  1761. X#    irreconcilable differences, the file is reported as C <user_file>,
  1762. X#    and as M <user_file> otherwise.
  1763. X#    Files added but not yet committed are reported as A <user_file>.
  1764. X#    Files removed but not yet decommitted are reported as R <user_file>.
  1765. X#
  1766. X#    If the present directory contains subdirectories that hold
  1767. X#    concurrent versions, these are updated too.  (See, however, CM.)
  1768. X#
  1769. X#    The -n option restricts the actions to reporting only.
  1770. X#
  1771. XName=UV; export Name
  1772. X
  1773. X# CVSBIN, CVSLIB and RCSBIN directories
  1774. XCVSBIN=/user1/dick/cvs
  1775. XCVSLIB=/user1/dick/cvs
  1776. XRCSBIN=${RCSBIN-/usr/new}
  1777. Xexport CVSBIN CVSLIB RCSBIN
  1778. X
  1779. X# avoid spurious identifications
  1780. XPATH=${CVSPATH-/bin:/usr/bin}; export PATH
  1781. X
  1782. X# determine the name of the repository
  1783. X. $CVSLIB/NR.aux
  1784. X
  1785. X# to ACT or not to ACT, that is the question
  1786. Xcase "$1" in
  1787. X-n)
  1788. X    ACT=echo
  1789. X    shift
  1790. X    ;;
  1791. X*)
  1792. X    ACT=
  1793. X    ;;
  1794. Xesac
  1795. X
  1796. X#    A T T E M P T   R E A D   A C C E S S
  1797. X
  1798. XLDR=$Repository                # the directory
  1799. XLCK=$LDR/\#cvs.lock            # the lock
  1800. XTFL=$LDR/\#cvs.tfl.$$            # a temporary test file
  1801. XRFL=$LDR/\#cvs.rfl.$$            # the personal read flag
  1802. X
  1803. Xif    # we have write access to $LDR (can't test with [ -w $LDR ] )
  1804. X    cp /dev/null $TFL >/dev/null 2>/dev/null
  1805. Xthen    # we can do a fully protected read
  1806. X    rm $TFL
  1807. X    
  1808. X    # set lock
  1809. X    . $CVSLIB/SL.aux        # persistently tries to mkdir $LCK
  1810. X    
  1811. X    #    C R I T I C A L   S E C T I O N
  1812. X    
  1813. X    cp /dev/null $RFL        # plant the personal read flag
  1814. X    rmdir $LCK            # remove lock
  1815. X    # set trap to remove flag on interrupt and exit
  1816. X    trap 'rm -f $RFL; exit' 0 1 2 3 15
  1817. X    
  1818. X    #    E N D   O F   C R I T I C A L   S E C T I O N
  1819. X
  1820. Xelse    # just use your luck, and some heuristics
  1821. X    while    # the lock is there
  1822. X        [ -d $LCK ]
  1823. X    do
  1824. X        # we missed it this cycle
  1825. X        echo $Name: `date`: waiting for the lock to disappear
  1826. X        
  1827. X        sleep 60
  1828. X    done
  1829. Xfi
  1830. X
  1831. X# determine the way we are called
  1832. Xcase $# in
  1833. X0)
  1834. X    # no file names: all pertinent files
  1835. X    set "`$CVSLIB/FN.aux $Repository`"
  1836. X    $ACT cp /dev/null CVS.adm/Mod
  1837. X    NOPARAMS=yes            # for directory search
  1838. X    ;;
  1839. Xesac
  1840. X
  1841. X# collect the sets of affected files
  1842. X
  1843. XOK=yes
  1844. X. $CVSLIB/CS.aux    # sets CLIST, GLIST, MLIST, OLIST, ALIST, RLIST, WLIST
  1845. X
  1846. Xcase $OK in
  1847. Xno)
  1848. X    echo $Name failed\; correct above errors first >&2
  1849. X    exit 1
  1850. Xesac
  1851. X
  1852. X# remove superfluous administration entries
  1853. Xfor User in $WLIST
  1854. Xdo
  1855. X    $ACT $CVSLIB/SC.aux $User
  1856. Xdone
  1857. X
  1858. X# do all the check-outs
  1859. X
  1860. Xfor User in $OLIST
  1861. Xdo
  1862. X    Rcs=$Repository/$User,v
  1863. X    
  1864. X    Tmp=,,$User
  1865. X    # put user file aside, but safety first
  1866. X    if    # $User exists
  1867. X        [ -r $User ]
  1868. X    then    # put it aside
  1869. X        $ACT mv $User $Tmp
  1870. X    else    # avoid confusion
  1871. X        $ACT rm -f $Tmp
  1872. X    fi
  1873. X    
  1874. X    if    # check out $Rcs into $User
  1875. X        $ACT $RCSBIN/co -q $Rcs $User
  1876. X    then    # adjust $User
  1877. X        $ACT chmod +w $User
  1878. X        # make a reference with the new time stamp
  1879. X        . $CVSLIB/VT.aux
  1880. X        $ACT $CVSLIB/RG.aux $User $VN_Rcs "$TS_User"
  1881. X    else
  1882. X        if    # there was a set-aside
  1883. X            [ -r $Tmp ]
  1884. X        then    # restore $User from it
  1885. X            $ACT mv $Tmp $User
  1886. X        fi
  1887. X        echo $Name: could not check out $User >&2
  1888. X        OK=no
  1889. X    fi
  1890. X    
  1891. X    # remove the set-aside
  1892. X    $ACT rm -f $Tmp
  1893. Xdone
  1894. X
  1895. X# report all modifications
  1896. Xfor User in $MLIST
  1897. Xdo
  1898. X    echo M $User
  1899. X    echo $User >>CVS.adm/Mod
  1900. Xdone
  1901. X
  1902. Xfor User in $ALIST
  1903. Xdo
  1904. X    echo A $User
  1905. Xdone
  1906. X
  1907. Xfor User in $RLIST
  1908. Xdo
  1909. X    echo R $User
  1910. Xdone
  1911. X
  1912. X# do all the merges
  1913. Xfor User in $GLIST
  1914. Xdo
  1915. X    Rcs=$Repository/$User,v
  1916. X    . $CVSLIB/VT.aux    # sets $VN_User, $VN_Rcs, $TS_User, $TS_Rcs
  1917. X    
  1918. X    if    # merge differences between $Rcs version $VN_User and
  1919. X        # head version of $Rcs into $User
  1920. X        $ACT $RCSBIN/rcsmerge -r$VN_User $Rcs 2>&1
  1921. X    then    :
  1922. X    else    # something very wrong
  1923. X        echo $Name: could not merge revision $VN_User of $User >&2
  1924. X        OK=no
  1925. X        continue
  1926. X    fi
  1927. X    
  1928. X    # register again with *OLD* time stamp and *NEW* version number
  1929. X    $ACT $CVSLIB/RG.aux $User $VN_Rcs "$TS_Rcs"
  1930. X    
  1931. X    if    # find out about conflicts the only way I know
  1932. X        grep '^>>>>>>> ' $User >/dev/null
  1933. X    then
  1934. X        echo $Name: conflicts found in $User >&2
  1935. X        echo C $User        # $User Conflict
  1936. X    else
  1937. X        echo M $User        # $User Modified
  1938. X    fi
  1939. X    echo $User >>CVS.adm/Mod
  1940. Xdone
  1941. X
  1942. Xsort -u CVS.adm/Mod -o CVS.adm/Mod
  1943. X
  1944. X# descend into lower directories, if any
  1945. Xcase $NOPARAMS in
  1946. Xyes)
  1947. X    for D in *
  1948. X    do
  1949. X        if    # $D for directory
  1950. X            [ -d $D ] \
  1951. X        &&    # $D holds a concurrent version
  1952. X            [ -d $D/CVS.adm ]
  1953. X        then    # recursively apply UV
  1954. X            (cd $D; $CVSBIN/UV)
  1955. X        fi
  1956. X    done
  1957. X    ;;
  1958. Xesac
  1959. X
  1960. X$CVSLIB/EF.aux                # update CVS.adm/Files
  1961. X
  1962. X# did we succeed?
  1963. Xcase $OK in
  1964. Xno)
  1965. X    exit 1
  1966. X    ;;
  1967. Xesac
  1968. X
  1969. Xexit 0
  1970. + END-OF-FILE UV
  1971. chmod 'u=rwx,g=rx,o=rx' \U\V
  1972. set `sum \U\V`
  1973. sum=$1
  1974. case $sum in
  1975. 55802)    :;;
  1976. *)    echo 'Bad sum in '\U\V >&2
  1977. esac
  1978. exit 0
  1979.