/contrib/cvs/doc/cvs.texinfo

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 14892 lines · 12594 code · 2298 blank · 0 comment · 0 complexity · 5b2b61113ddb78ea6f25ebc2d0559833 MD5 · raw file

Large files are truncated click here to view the full file

  1. \input texinfo @c -*-texinfo-*-
  2. @comment Documentation for CVS.
  3. @setfilename cvs.info
  4. @macro copyleftnotice
  5. @noindent
  6. Copyright @copyright{} 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
  7. 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
  8. Free Software Foundation, Inc.
  9. @multitable @columnfractions .12 .88
  10. @item Portions
  11. @item @tab Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2005,
  12. 2006, 2007 Derek R. Price,
  13. @item @tab Copyright @copyright{} 2002, 2003, 2004, 2005, 2006, 2007
  14. Ximbiot @url{http://ximbiot.com},
  15. @item @tab Copyright @copyright{} 1992, 1993, 1999 Signum Support AB,
  16. @item @tab and Copyright @copyright{} others.
  17. @end multitable
  18. @ignore
  19. Permission is granted to process this file through Tex and print the
  20. results, provided the printed document carries copying permission
  21. notice identical to this one except for the removal of this paragraph
  22. (this paragraph not being relevant to the printed manual).
  23. @end ignore
  24. Permission is granted to make and distribute verbatim copies of
  25. this manual provided the copyright notice and this permission notice
  26. are preserved on all copies.
  27. Permission is granted to copy and distribute modified versions of this
  28. manual under the conditions for verbatim copying, provided also that the
  29. entire resulting derived work is distributed under the terms of a
  30. permission notice identical to this one.
  31. Permission is granted to copy and distribute translations of this manual
  32. into another language, under the above conditions for modified versions,
  33. except that this permission notice may be stated in a translation
  34. approved by the Free Software Foundation.
  35. @end macro
  36. @comment This file is part of the CVS distribution.
  37. @comment CVS is free software; you can redistribute it and/or modify
  38. @comment it under the terms of the GNU General Public License as published by
  39. @comment the Free Software Foundation; either version 2, or (at your option)
  40. @comment any later version.
  41. @comment CVS is distributed in the hope that it will be useful,
  42. @comment but WITHOUT ANY WARRANTY; without even the implied warranty of
  43. @comment MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  44. @comment GNU General Public License for more details.
  45. @c See ../README for A4 vs. US letter size.
  46. @c When we provided A4 postscript, and people tried to
  47. @c print it on US letter, the usual complaint was that the
  48. @c page numbers would get cut off.
  49. @c If one prints US letter on A4, reportedly there is
  50. @c some extra space at the top and/or bottom, and the side
  51. @c margins are a bit narrow, but no text is lost.
  52. @c
  53. @c See
  54. @c http://www.ft.uni-erlangen.de/~mskuhn/iso-paper.html
  55. @c for more on paper sizes. Insuring that margins are
  56. @c big enough to print on either A4 or US letter does
  57. @c indeed seem to be the usual approach (RFC2346).
  58. @c This document seems to get overfull hboxes with some
  59. @c frequency (probably because the tendency is to
  60. @c sanity-check it with "make info" and run TeX less
  61. @c often). The big ugly boxes just seem to add insult
  62. @c to injury, and I'm not aware of them helping to fix
  63. @c the overfull hboxes at all.
  64. @finalout
  65. @include version.texi
  66. @settitle CVS---Concurrent Versions System v@value{VERSION}
  67. @setchapternewpage odd
  68. @c -- TODO list:
  69. @c -- Fix all lines that match "^@c -- "
  70. @c -- Also places marked with FIXME should be manual
  71. @c problems (as opposed to FIXCVS for CVS problems).
  72. @c @splitrcskeyword{} is used to avoid keyword expansion. It is replaced by
  73. @c @asis when generating info and dvi, and by <i></i> in the generated html,
  74. @c such that keywords are not expanded in the generated html.
  75. @ifnothtml
  76. @macro splitrcskeyword {arg}
  77. @asis{}\arg\
  78. @end macro
  79. @end ifnothtml
  80. @ifhtml
  81. @macro splitrcskeyword {arg}
  82. @i{}\arg\
  83. @end macro
  84. @end ifhtml
  85. @dircategory GNU Packages
  86. @direntry
  87. * CVS: (cvs). Concurrent Versions System
  88. @end direntry
  89. @dircategory Individual utilities
  90. @direntry
  91. * cvs: (cvs)CVS commands. Concurrent Versions System
  92. @end direntry
  93. @comment The titlepage section does not appear in the Info file.
  94. @titlepage
  95. @sp 4
  96. @comment The title is printed in a large font.
  97. @center @titlefont{Version Management}
  98. @sp
  99. @center @titlefont{with}
  100. @sp
  101. @center @titlefont{CVS}
  102. @sp 2
  103. @center for @sc{cvs} @value{VERSION}
  104. @comment -release-
  105. @sp 3
  106. @center Per Cederqvist et al
  107. @comment The following two commands start the copyright page
  108. @comment for the printed manual. This will not appear in the Info file.
  109. @page
  110. @vskip 0pt plus 1filll
  111. @copyleftnotice
  112. @end titlepage
  113. @summarycontents
  114. @contents
  115. @comment ================================================================
  116. @comment The real text starts here
  117. @comment ================================================================
  118. @ifnottex
  119. @c ---------------------------------------------------------------------
  120. @node Top
  121. @top
  122. This info manual describes how to use and administer
  123. @sc{cvs} version @value{VERSION}.
  124. @end ifnottex
  125. @ifinfo
  126. @copyleftnotice
  127. @end ifinfo
  128. @c This menu is pretty long. Not sure how easily that
  129. @c can be fixed (no brilliant ideas right away)...
  130. @menu
  131. * Overview:: An introduction to CVS
  132. * Repository:: Where all your sources are stored
  133. * Starting a new project:: Starting a project with CVS
  134. * Revisions:: Numeric and symbolic names for revisions
  135. * Branching and merging:: Diverging/rejoining branches of development
  136. * Recursive behavior:: CVS descends directories
  137. * Adding and removing:: Adding/removing/renaming files/directories
  138. * History browsing:: Viewing the history of files in various ways
  139. CVS and the Real World.
  140. -----------------------
  141. * Binary files:: CVS can handle binary files
  142. * Multiple developers:: How CVS helps a group of developers
  143. * Revision management:: Policy questions for revision management
  144. * Keyword substitution:: CVS can include the revision inside the file
  145. * Tracking sources:: Tracking third-party sources
  146. * Builds:: Issues related to CVS and builds
  147. * Special Files:: Devices, links and other non-regular files
  148. References.
  149. -----------
  150. * CVS commands:: CVS commands share some things
  151. * Invoking CVS:: Quick reference to CVS commands
  152. * Administrative files:: Reference manual for the Administrative files
  153. * Environment variables:: All environment variables which affect CVS
  154. * Compatibility:: Upgrading CVS versions
  155. * Troubleshooting:: Some tips when nothing works
  156. * Credits:: Some of the contributors to this manual
  157. * BUGS:: Dealing with bugs in CVS or this manual
  158. * Index:: Index
  159. @end menu
  160. @c ---------------------------------------------------------------------
  161. @node Overview
  162. @chapter Overview
  163. @cindex Overview
  164. This chapter is for people who have never used
  165. @sc{cvs}, and perhaps have never used version control
  166. software before.
  167. If you are already familiar with @sc{cvs} and are just
  168. trying to learn a particular feature or remember a
  169. certain command, you can probably skip everything here.
  170. @menu
  171. * What is CVS?:: What you can do with @sc{cvs}
  172. * What is CVS not?:: Problems @sc{cvs} doesn't try to solve
  173. * A sample session:: A tour of basic @sc{cvs} usage
  174. @end menu
  175. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  176. @node What is CVS?
  177. @section What is CVS?
  178. @cindex What is CVS?
  179. @cindex Introduction to CVS
  180. @cindex CVS, introduction to
  181. @sc{cvs} is a version control system. Using it, you can
  182. record the history of your source files.
  183. @c -- ///
  184. @c -- ///Those who cannot remember the past are condemned to repeat it.
  185. @c -- /// -- George Santayana
  186. @c -- //////
  187. @c -- Insert history quote here!
  188. For example, bugs sometimes creep in when
  189. software is modified, and you might not detect the bug
  190. until a long time after you make the modification.
  191. With @sc{cvs}, you can easily retrieve old versions to see
  192. exactly which change caused the bug. This can
  193. sometimes be a big help.
  194. You could of course save every version of every file
  195. you have ever created. This would
  196. however waste an enormous amount of disk space. @sc{cvs}
  197. stores all the versions of a file in a single file in a
  198. clever way that only stores the differences between
  199. versions.
  200. @sc{cvs} also helps you if you are part of a group of people working
  201. on the same project. It is all too easy to overwrite
  202. each others' changes unless you are extremely careful.
  203. Some editors, like @sc{gnu} Emacs, try to make sure that
  204. two people never modify the same file at the
  205. same time. Unfortunately, if someone is using another
  206. editor, that safeguard will not work. @sc{cvs} solves this problem
  207. by insulating the different developers from each other. Every
  208. developer works in his own directory, and @sc{cvs} merges
  209. the work when each developer is done.
  210. @cindex History of CVS
  211. @cindex CVS, history of
  212. @cindex Credits (CVS program)
  213. @cindex Contributors (CVS program)
  214. @sc{cvs} started out as a bunch of shell scripts written by
  215. Dick Grune, posted to the newsgroup
  216. @code{comp.sources.unix} in the volume 6
  217. release of July, 1986. While no actual code from
  218. these shell scripts is present in the current version
  219. of @sc{cvs} much of the @sc{cvs} conflict resolution algorithms
  220. come from them.
  221. In April, 1989, Brian Berliner designed and coded @sc{cvs}.
  222. Jeff Polk later helped Brian with the design of the @sc{cvs}
  223. module and vendor branch support.
  224. @cindex Source, getting CVS source
  225. You can get @sc{cvs} in a variety of ways, including
  226. free download from the Internet. For more information
  227. on downloading @sc{cvs} and other @sc{cvs} topics, see:
  228. @example
  229. @url{http://cvs.nongnu.org/}
  230. @end example
  231. @cindex Mailing list
  232. @cindex List, mailing list
  233. @cindex Newsgroups
  234. There is a mailing list, known as @email{info-cvs@@nongnu.org},
  235. devoted to @sc{cvs}. To subscribe or
  236. unsubscribe
  237. write to
  238. @email{info-cvs-request@@nongnu.org}.
  239. If you prefer a Usenet group, there is a one-way mirror (posts to the email
  240. list are usually sent to the news group, but not vice versa) of
  241. @email{info-cvs@@nongnu.org} at @url{news:gnu.cvs.help}. The right
  242. Usenet group for posts is @url{news:comp.software.config-mgmt} which is for
  243. @sc{cvs} discussions (along with other configuration
  244. management systems). In the future, it might be
  245. possible to create a
  246. @code{comp.software.config-mgmt.cvs}, but probably only
  247. if there is sufficient @sc{cvs} traffic on
  248. @url{news:comp.software.config-mgmt}.
  249. @c Other random data is that the tale was very
  250. @c skeptical of comp.software.config-mgmt.cvs when the
  251. @c subject came up around 1995 or so (for one
  252. @c thing, because creating it would be a "reorg" which
  253. @c would need to take a more comprehensive look at the
  254. @c whole comp.software.config-mgmt.* hierarchy).
  255. You can also subscribe to the @email{bug-cvs@@nongnu.org} mailing list,
  256. described in more detail in @ref{BUGS}. To subscribe
  257. send mail to @email{bug-cvs-request@@nongnu.org}. There is a two-way
  258. Usenet mirror (posts to the Usenet group are usually sent to the email list and
  259. vice versa) of @email{bug-cvs@@nongnu.org} named @url{news:gnu.cvs.bug}.
  260. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  261. @node What is CVS not?
  262. @section What is CVS not?
  263. @cindex What is CVS not?
  264. @sc{cvs} can do a lot of things for you, but it does
  265. not try to be everything for everyone.
  266. @table @asis
  267. @item @sc{cvs} is not a build system.
  268. Though the structure of your repository and modules
  269. file interact with your build system
  270. (e.g. @file{Makefile}s), they are essentially
  271. independent.
  272. @sc{cvs} does not dictate how you build anything. It
  273. merely stores files for retrieval in a tree structure
  274. you devise.
  275. @sc{cvs} does not dictate how to use disk space in the
  276. checked out working directories. If you write your
  277. @file{Makefile}s or scripts in every directory so they
  278. have to know the relative positions of everything else,
  279. you wind up requiring the entire repository to be
  280. checked out.
  281. If you modularize your work, and construct a build
  282. system that will share files (via links, mounts,
  283. @code{VPATH} in @file{Makefile}s, etc.), you can
  284. arrange your disk usage however you like.
  285. But you have to remember that @emph{any} such system is
  286. a lot of work to construct and maintain. @sc{cvs} does
  287. not address the issues involved.
  288. Of course, you should place the tools created to
  289. support such a build system (scripts, @file{Makefile}s,
  290. etc.) under @sc{cvs}.
  291. Figuring out what files need to be rebuilt when
  292. something changes is, again, something to be handled
  293. outside the scope of @sc{cvs}. One traditional
  294. approach is to use @code{make} for building, and use
  295. some automated tool for generating the dependencies which
  296. @code{make} uses.
  297. See @ref{Builds}, for more information on doing builds
  298. in conjunction with @sc{cvs}.
  299. @item @sc{cvs} is not a substitute for management.
  300. Your managers and project leaders are expected to talk
  301. to you frequently enough to make certain you are aware
  302. of schedules, merge points, branch names and release
  303. dates. If they don't, @sc{cvs} can't help.
  304. @sc{cvs} is an instrument for making sources dance to
  305. your tune. But you are the piper and the composer. No
  306. instrument plays itself or writes its own music.
  307. @item @sc{cvs} is not a substitute for developer communication.
  308. When faced with conflicts within a single file, most
  309. developers manage to resolve them without too much
  310. effort. But a more general definition of ``conflict''
  311. includes problems too difficult to solve without
  312. communication between developers.
  313. @sc{cvs} cannot determine when simultaneous changes
  314. within a single file, or across a whole collection of
  315. files, will logically conflict with one another. Its
  316. concept of a @dfn{conflict} is purely textual, arising
  317. when two changes to the same base file are near enough
  318. to spook the merge (i.e., @code{diff3}) command.
  319. @sc{cvs} does not claim to help at all in figuring out
  320. non-textual or distributed conflicts in program logic.
  321. For example: Say you change the arguments to function
  322. @code{X} defined in file @file{A}. At the same time,
  323. someone edits file @file{B}, adding new calls to
  324. function @code{X} using the old arguments. You are
  325. outside the realm of @sc{cvs}'s competence.
  326. Acquire the habit of reading specs and talking to your
  327. peers.
  328. @item @sc{cvs} does not have change control
  329. Change control refers to a number of things. First of
  330. all it can mean @dfn{bug-tracking}, that is being able
  331. to keep a database of reported bugs and the status of
  332. each one (Is it fixed? In what release? Has the bug
  333. submitter agreed that it is fixed?). For interfacing
  334. @sc{cvs} to an external bug-tracking system, see the
  335. @file{rcsinfo} and @file{verifymsg} files
  336. (@pxref{Administrative files}).
  337. Another aspect of change control is keeping track of
  338. the fact that changes to several files were in fact
  339. changed together as one logical change. If you check
  340. in several files in a single @code{cvs commit}
  341. operation, @sc{cvs} then forgets that those files were
  342. checked in together, and the fact that they have the
  343. same log message is the only thing tying them
  344. together. Keeping a @sc{gnu} style @file{ChangeLog}
  345. can help somewhat.
  346. @c FIXME: should have an xref to a section which talks
  347. @c more about keeping ChangeLog's with CVS, but that
  348. @c section hasn't been written yet.
  349. Another aspect of change control, in some systems, is
  350. the ability to keep track of the status of each
  351. change. Some changes have been written by a developer,
  352. others have been reviewed by a second developer, and so
  353. on. Generally, the way to do this with @sc{cvs} is to
  354. generate a diff (using @code{cvs diff} or @code{diff})
  355. and email it to someone who can then apply it using the
  356. @code{patch} utility. This is very flexible, but
  357. depends on mechanisms outside @sc{cvs} to make sure
  358. nothing falls through the cracks.
  359. @item @sc{cvs} is not an automated testing program
  360. It should be possible to enforce mandatory use of a
  361. test suite using the @code{commitinfo} file. I haven't
  362. heard a lot about projects trying to do that or whether
  363. there are subtle gotchas, however.
  364. @item @sc{cvs} does not have a built-in process model
  365. Some systems provide ways to ensure that changes or
  366. releases go through various steps, with various
  367. approvals as needed. Generally, one can accomplish
  368. this with @sc{cvs} but it might be a little more work.
  369. In some cases you'll want to use the @file{commitinfo},
  370. @file{loginfo}, @file{rcsinfo}, or @file{verifymsg}
  371. files, to require that certain steps be performed
  372. before cvs will allow a checkin. Also consider whether
  373. features such as branches and tags can be used to
  374. perform tasks such as doing work in a development tree
  375. and then merging certain changes over to a stable tree
  376. only once they have been proven.
  377. @end table
  378. @c ---------------------------------------------------------------------
  379. @node A sample session
  380. @section A sample session
  381. @cindex Example of a work-session
  382. @cindex Getting started
  383. @cindex Work-session, example of
  384. @cindex tc, Trivial Compiler (example)
  385. @cindex Trivial Compiler (example)
  386. @c I think an example is a pretty good way to start. But
  387. @c somewhere in here, maybe after the sample session,
  388. @c we need something which is kind of
  389. @c a "roadmap" which is more directed at sketching out
  390. @c the functionality of CVS and pointing people to
  391. @c various other parts of the manual. As it stands now
  392. @c people who read in order get dumped right into all
  393. @c manner of hair regarding remote repositories,
  394. @c creating a repository, etc.
  395. @c
  396. @c The following was in the old Basic concepts node. I don't
  397. @c know how good a job it does at introducing modules,
  398. @c or whether they need to be introduced so soon, but
  399. @c something of this sort might go into some
  400. @c introductory material somewhere.
  401. @ignore
  402. @cindex Modules (intro)
  403. The repository contains directories and files, in an
  404. arbitrary tree. The @dfn{modules} feature can be used
  405. to group together a set of directories or files into a
  406. single entity (@pxref{modules}). A typical usage is to
  407. define one module per project.
  408. @end ignore
  409. As a way of introducing @sc{cvs}, we'll go through a
  410. typical work-session using @sc{cvs}. The first thing
  411. to understand is that @sc{cvs} stores all files in a
  412. centralized @dfn{repository} (@pxref{Repository}); this
  413. section assumes that a repository is set up.
  414. @c I'm not sure that the sentence concerning the
  415. @c repository quite tells the user what they need to
  416. @c know at this point. Might need to expand on "centralized"
  417. @c slightly (maybe not here, maybe further down in the example?)
  418. Suppose you are working on a simple compiler. The source
  419. consists of a handful of C files and a @file{Makefile}.
  420. The compiler is called @samp{tc} (Trivial Compiler),
  421. and the repository is set up so that there is a module
  422. called @samp{tc}.
  423. @menu
  424. * Getting the source:: Creating a workspace
  425. * Committing your changes:: Making your work available to others
  426. * Cleaning up:: Cleaning up
  427. * Viewing differences:: Viewing differences
  428. @end menu
  429. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  430. @node Getting the source
  431. @subsection Getting the source
  432. @cindex Getting the source
  433. @cindex Checking out source
  434. @cindex Fetching source
  435. @cindex Source, getting from CVS
  436. @cindex Checkout, example
  437. The first thing you must do is to get your own working copy of the
  438. source for @samp{tc}. For this, you use the @code{checkout} command:
  439. @example
  440. $ cvs checkout tc
  441. @end example
  442. @noindent
  443. This will create a new directory called @file{tc} and populate it with
  444. the source files.
  445. @example
  446. $ cd tc
  447. $ ls
  448. CVS Makefile backend.c driver.c frontend.c parser.c
  449. @end example
  450. The @file{CVS} directory is used internally by
  451. @sc{cvs}. Normally, you should not modify or remove
  452. any of the files in it.
  453. You start your favorite editor, hack away at @file{backend.c}, and a couple
  454. of hours later you have added an optimization pass to the compiler.
  455. A note to @sc{rcs} and @sc{sccs} users: There is no need to lock the files that
  456. you want to edit. @xref{Multiple developers}, for an explanation.
  457. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  458. @node Committing your changes
  459. @subsection Committing your changes
  460. @cindex Committing changes to files
  461. @cindex Log message entry
  462. When you have checked that the compiler is still compilable you decide
  463. to make a new version of @file{backend.c}. This will
  464. store your new @file{backend.c} in the repository and
  465. make it available to anyone else who is using that same
  466. repository.
  467. @example
  468. $ cvs commit backend.c
  469. @end example
  470. @noindent
  471. @sc{cvs} starts an editor, to allow you to enter a log
  472. message. You type in ``Added an optimization pass.'',
  473. save the temporary file, and exit the editor.
  474. @cindex CVSEDITOR, environment variable
  475. @cindex EDITOR, environment variable
  476. The environment variable @code{$CVSEDITOR} determines
  477. which editor is started. If @code{$CVSEDITOR} is not
  478. set, then if the environment variable @code{$EDITOR} is
  479. set, it will be used. If both @code{$CVSEDITOR} and
  480. @code{$EDITOR} are not set then there is a default
  481. which will vary with your operating system, for example
  482. @code{vi} for unix or @code{notepad} for Windows
  483. NT/95.
  484. @cindex VISUAL, environment variable
  485. In addition, @sc{cvs} checks the @code{$VISUAL} environment
  486. variable. Opinions vary on whether this behavior is desirable and
  487. whether future releases of @sc{cvs} should check @code{$VISUAL} or
  488. ignore it. You will be OK either way if you make sure that
  489. @code{$VISUAL} is either unset or set to the same thing as
  490. @code{$EDITOR}.
  491. @c This probably should go into some new node
  492. @c containing detailed info on the editor, rather than
  493. @c the intro. In fact, perhaps some of the stuff with
  494. @c CVSEDITOR and -m and so on should too.
  495. When @sc{cvs} starts the editor, it includes a list of
  496. files which are modified. For the @sc{cvs} client,
  497. this list is based on comparing the modification time
  498. of the file against the modification time that the file
  499. had when it was last gotten or updated. Therefore, if
  500. a file's modification time has changed but its contents
  501. have not, it will show up as modified. The simplest
  502. way to handle this is simply not to worry about it---if
  503. you proceed with the commit @sc{cvs} will detect that
  504. the contents are not modified and treat it as an
  505. unmodified file. The next @code{update} will clue
  506. @sc{cvs} in to the fact that the file is unmodified,
  507. and it will reset its stored timestamp so that the file
  508. will not show up in future editor sessions.
  509. @c FIXCVS: Might be nice if "commit" and other commands
  510. @c would reset that timestamp too, but currently commit
  511. @c doesn't.
  512. @c FIXME: Need to talk more about the process of
  513. @c prompting for the log message. Like show an example
  514. @c of what it pops up in the editor, for example. Also
  515. @c a discussion of how to get the "a)bort, c)ontinue,
  516. @c e)dit" prompt and what to do with it. Might also
  517. @c work in the suggestion that if you want a diff, you
  518. @c should make it before running commit (someone
  519. @c suggested that the diff pop up in the editor. I'm
  520. @c not sure that is better than telling people to run
  521. @c "cvs diff" first if that is what they want, but if
  522. @c we want to tell people that, the manual possibly
  523. @c should say it).
  524. If you want to avoid
  525. starting an editor you can specify the log message on
  526. the command line using the @samp{-m} flag instead, like
  527. this:
  528. @example
  529. $ cvs commit -m "Added an optimization pass" backend.c
  530. @end example
  531. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  532. @node Cleaning up
  533. @subsection Cleaning up
  534. @cindex Cleaning up
  535. @cindex Working copy, removing
  536. @cindex Removing your working copy
  537. @cindex Releasing your working copy
  538. Before you turn to other tasks you decide to remove your working copy of
  539. tc. One acceptable way to do that is of course
  540. @example
  541. $ cd ..
  542. $ rm -r tc
  543. @end example
  544. @noindent
  545. but a better way is to use the @code{release} command (@pxref{release}):
  546. @example
  547. $ cd ..
  548. $ cvs release -d tc
  549. M driver.c
  550. ? tc
  551. You have [1] altered files in this repository.
  552. Are you sure you want to release (and delete) directory `tc': n
  553. ** `release' aborted by user choice.
  554. @end example
  555. The @code{release} command checks that all your modifications have been
  556. committed. If history logging is enabled it also makes a note in the
  557. history file. @xref{history file}.
  558. When you use the @samp{-d} flag with @code{release}, it
  559. also removes your working copy.
  560. In the example above, the @code{release} command wrote a couple of lines
  561. of output. @samp{? tc} means that the file @file{tc} is unknown to @sc{cvs}.
  562. That is nothing to worry about: @file{tc} is the executable compiler,
  563. and it should not be stored in the repository. @xref{cvsignore},
  564. for information about how to make that warning go away.
  565. @xref{release output}, for a complete explanation of
  566. all possible output from @code{release}.
  567. @samp{M driver.c} is more serious. It means that the
  568. file @file{driver.c} has been modified since it was
  569. checked out.
  570. The @code{release} command always finishes by telling
  571. you how many modified files you have in your working
  572. copy of the sources, and then asks you for confirmation
  573. before deleting any files or making any note in the
  574. history file.
  575. You decide to play it safe and answer @kbd{n @key{RET}}
  576. when @code{release} asks for confirmation.
  577. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  578. @node Viewing differences
  579. @subsection Viewing differences
  580. @cindex Viewing differences
  581. @cindex Diff
  582. You do not remember modifying @file{driver.c}, so you want to see what
  583. has happened to that file.
  584. @example
  585. $ cd tc
  586. $ cvs diff driver.c
  587. @end example
  588. This command runs @code{diff} to compare the version of @file{driver.c}
  589. that you checked out with your working copy. When you see the output
  590. you remember that you added a command line option that enabled the
  591. optimization pass. You check it in, and release the module.
  592. @c FIXME: we haven't yet defined the term "check in".
  593. @example
  594. $ cvs commit -m "Added an optimization pass" driver.c
  595. Checking in driver.c;
  596. /usr/local/cvsroot/tc/driver.c,v <-- driver.c
  597. new revision: 1.2; previous revision: 1.1
  598. done
  599. $ cd ..
  600. $ cvs release -d tc
  601. ? tc
  602. You have [0] altered files in this repository.
  603. Are you sure you want to release (and delete) directory `tc': y
  604. @end example
  605. @c ---------------------------------------------------------------------
  606. @node Repository
  607. @chapter The Repository
  608. @cindex Repository (intro)
  609. @cindex Repository, example
  610. @cindex Layout of repository
  611. @cindex Typical repository
  612. @cindex /usr/local/cvsroot, as example repository
  613. @cindex cvsroot
  614. The @sc{cvs} @dfn{repository} stores a complete copy of
  615. all the files and directories which are under version
  616. control.
  617. Normally, you never access any of the files in the
  618. repository directly. Instead, you use @sc{cvs}
  619. commands to get your own copy of the files into a
  620. @dfn{working directory}, and then
  621. work on that copy. When you've finished a set of
  622. changes, you check (or @dfn{commit}) them back into the
  623. repository. The repository then contains the changes
  624. which you have made, as well as recording exactly what
  625. you changed, when you changed it, and other such
  626. information. Note that the repository is not a
  627. subdirectory of the working directory, or vice versa;
  628. they should be in separate locations.
  629. @c Need some example, e.g. repository
  630. @c /usr/local/cvsroot; working directory
  631. @c /home/joe/sources. But this node is too long
  632. @c as it is; need a little reorganization...
  633. @cindex :local:, setting up
  634. @sc{cvs} can access a repository by a variety of
  635. means. It might be on the local computer, or it might
  636. be on a computer across the room or across the world.
  637. To distinguish various ways to access a repository, the
  638. repository name can start with an @dfn{access method}.
  639. For example, the access method @code{:local:} means to
  640. access a repository directory, so the repository
  641. @code{:local:/usr/local/cvsroot} means that the
  642. repository is in @file{/usr/local/cvsroot} on the
  643. computer running @sc{cvs}. For information on other
  644. access methods, see @ref{Remote repositories}.
  645. @c Can se say this more concisely? Like by passing
  646. @c more of the buck to the Remote repositories node?
  647. If the access method is omitted, then if the repository
  648. starts with @samp{/}, then @code{:local:} is
  649. assumed. If it does not start with @samp{/} then either
  650. @code{:ext:} or @code{:server:} is assumed. For
  651. example, if you have a local repository in
  652. @file{/usr/local/cvsroot}, you can use
  653. @code{/usr/local/cvsroot} instead of
  654. @code{:local:/usr/local/cvsroot}. But if (under
  655. Windows NT, for example) your local repository is
  656. @file{c:\src\cvsroot}, then you must specify the access
  657. method, as in @code{:local:c:/src/cvsroot}.
  658. @c This might appear to go in Repository storage, but
  659. @c actually it is describing something which is quite
  660. @c user-visible, when you do a "cvs co CVSROOT". This
  661. @c isn't necessary the perfect place for that, though.
  662. The repository is split in two parts. @file{$CVSROOT/CVSROOT} contains
  663. administrative files for @sc{cvs}. The other directories contain the actual
  664. user-defined modules.
  665. @menu
  666. * Specifying a repository:: Telling CVS where your repository is
  667. * Repository storage:: The structure of the repository
  668. * Working directory storage:: The structure of working directories
  669. * Intro administrative files:: Defining modules
  670. * Multiple repositories:: Multiple repositories
  671. * Creating a repository:: Creating a repository
  672. * Backing up:: Backing up a repository
  673. * Moving a repository:: Moving a repository
  674. * Remote repositories:: Accessing repositories on remote machines
  675. * Read-only access:: Granting read-only access to the repository
  676. * Server temporary directory:: The server creates temporary directories
  677. @end menu
  678. @node Specifying a repository
  679. @section Telling CVS where your repository is
  680. There are several ways to tell @sc{cvs}
  681. where to find the repository. You can name the
  682. repository on the command line explicitly, with the
  683. @code{-d} (for "directory") option:
  684. @example
  685. cvs -d /usr/local/cvsroot checkout yoyodyne/tc
  686. @end example
  687. @cindex .profile, setting CVSROOT in
  688. @cindex .cshrc, setting CVSROOT in
  689. @cindex .tcshrc, setting CVSROOT in
  690. @cindex .bashrc, setting CVSROOT in
  691. @cindex CVSROOT, environment variable
  692. Or you can set the @code{$CVSROOT} environment
  693. variable to an absolute path to the root of the
  694. repository, @file{/usr/local/cvsroot} in this example.
  695. To set @code{$CVSROOT}, @code{csh} and @code{tcsh}
  696. users should have this line in their @file{.cshrc} or
  697. @file{.tcshrc} files:
  698. @example
  699. setenv CVSROOT /usr/local/cvsroot
  700. @end example
  701. @noindent
  702. @code{sh} and @code{bash} users should instead have these lines in their
  703. @file{.profile} or @file{.bashrc}:
  704. @example
  705. CVSROOT=/usr/local/cvsroot
  706. export CVSROOT
  707. @end example
  708. @cindex Root file, in CVS directory
  709. @cindex CVS/Root file
  710. A repository specified with @code{-d} will
  711. override the @code{$CVSROOT} environment variable.
  712. Once you've checked a working copy out from the
  713. repository, it will remember where its repository is
  714. (the information is recorded in the
  715. @file{CVS/Root} file in the working copy).
  716. The @code{-d} option and the @file{CVS/Root} file both
  717. override the @code{$CVSROOT} environment variable. If
  718. @code{-d} option differs from @file{CVS/Root}, the
  719. former is used. Of course, for proper operation they
  720. should be two ways of referring to the same repository.
  721. @c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  722. @node Repository storage
  723. @section How data is stored in the repository
  724. @cindex Repository, how data is stored
  725. For most purposes it isn't important @emph{how}
  726. @sc{cvs} stores information in the repository. In
  727. fact, the format has changed in the past, and is likely
  728. to change in the future. Since in almost all cases one
  729. accesses the repository via @sc{cvs} commands, such
  730. changes need not be disruptive.
  731. However, in some cases it may be necessary to
  732. understand how @sc{cvs} stores data in the repository,
  733. for example you might need to track down @sc{cvs} locks
  734. (@pxref{Concurrency}) or you might need to deal with
  735. the file permissions appropriate for the repository.
  736. @menu
  737. * Repository files:: What files are stored in the repository
  738. * File permissions:: File permissions
  739. * Windows permissions:: Issues specific to Windows
  740. * Attic:: Some files are stored in the Attic
  741. * CVS in repository:: Additional information in CVS directory
  742. * Locks:: CVS locks control concurrent accesses
  743. * CVSROOT storage:: A few things about CVSROOT are different
  744. @end menu
  745. @node Repository files
  746. @subsection Where files are stored within the repository
  747. @c @cindex Filenames, legal
  748. @c @cindex Legal filenames
  749. @c Somewhere we need to say something about legitimate
  750. @c characters in filenames in working directory and
  751. @c repository. Not "/" (not even on non-unix). And
  752. @c here is a specific set of issues:
  753. @c Files starting with a - are handled inconsistently. They can not
  754. @c be added to a repository with an add command, because it they are
  755. @c interpreted as a switch. They can appear in a repository if they are
  756. @c part of a tree that is imported. They can not be removed from the tree
  757. @c once they are there.
  758. @c Note that "--" *is* supported (as a
  759. @c consequence of using GNU getopt). Should document
  760. @c this somewhere ("Common options"?). The other usual technique,
  761. @c "./-foo", isn't as effective, at least for "cvs add"
  762. @c which doesn't support pathnames containing "/".
  763. The overall structure of the repository is a directory
  764. tree corresponding to the directories in the working
  765. directory. For example, supposing the repository is in
  766. @example
  767. /usr/local/cvsroot
  768. @end example
  769. @noindent
  770. here is a possible directory tree (showing only the
  771. directories):
  772. @example
  773. @t{/usr}
  774. |
  775. +--@t{local}
  776. | |
  777. | +--@t{cvsroot}
  778. | | |
  779. | | +--@t{CVSROOT}
  780. | (administrative files)
  781. |
  782. +--@t{gnu}
  783. | |
  784. | +--@t{diff}
  785. | | (source code to @sc{gnu} diff)
  786. | |
  787. | +--@t{rcs}
  788. | | (source code to @sc{rcs})
  789. | |
  790. | +--@t{cvs}
  791. | (source code to @sc{cvs})
  792. |
  793. +--@t{yoyodyne}
  794. |
  795. +--@t{tc}
  796. | |
  797. | +--@t{man}
  798. | |
  799. | +--@t{testing}
  800. |
  801. +--(other Yoyodyne software)
  802. @end example
  803. With the directories are @dfn{history files} for each file
  804. under version control. The name of the history file is
  805. the name of the corresponding file with @samp{,v}
  806. appended to the end. Here is what the repository for
  807. the @file{yoyodyne/tc} directory might look like:
  808. @c FIXME: Should also mention CVS (CVSREP)
  809. @c FIXME? Should we introduce Attic with an xref to
  810. @c Attic? Not sure whether that is a good idea or not.
  811. @example
  812. @code{$CVSROOT}
  813. |
  814. +--@t{yoyodyne}
  815. | |
  816. | +--@t{tc}
  817. | | |
  818. +--@t{Makefile,v}
  819. +--@t{backend.c,v}
  820. +--@t{driver.c,v}
  821. +--@t{frontend.c,v}
  822. +--@t{parser.c,v}
  823. +--@t{man}
  824. | |
  825. | +--@t{tc.1,v}
  826. |
  827. +--@t{testing}
  828. |
  829. +--@t{testpgm.t,v}
  830. +--@t{test2.t,v}
  831. @end example
  832. @cindex History files
  833. @cindex RCS history files
  834. @c The first sentence, about what history files
  835. @c contain, is kind of redundant with our intro to what the
  836. @c repository does in node Repository....
  837. The history files contain, among other things, enough
  838. information to recreate any revision of the file, a log
  839. of all commit messages and the user-name of the person
  840. who committed the revision. The history files are
  841. known as @dfn{RCS files}, because the first program to
  842. store files in that format was a version control system
  843. known as @sc{rcs}. For a full
  844. description of the file format, see the @code{man} page
  845. @cite{rcsfile(5)}, distributed with @sc{rcs}, or the
  846. file @file{doc/RCSFILES} in the @sc{cvs} source
  847. distribution. This
  848. file format has become very common---many systems other
  849. than @sc{cvs} or @sc{rcs} can at least import history
  850. files in this format.
  851. @c FIXME: Think about including documentation for this
  852. @c rather than citing it? In the long run, getting
  853. @c this to be a standard (not sure if we can cope with
  854. @c a standards process as formal as IEEE/ANSI/ISO/etc,
  855. @c though...) is the way to go, so maybe citing is
  856. @c better.
  857. The @sc{rcs} files used in @sc{cvs} differ in a few
  858. ways from the standard format. The biggest difference
  859. is magic branches; for more information see @ref{Magic
  860. branch numbers}. Also in @sc{cvs} the valid tag names
  861. are a subset of what @sc{rcs} accepts; for @sc{cvs}'s
  862. rules see @ref{Tags}.
  863. @c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  864. @node File permissions
  865. @subsection File permissions
  866. @c -- Move this to @node Creating a repository or similar
  867. @cindex Security, file permissions in repository
  868. @cindex File permissions, general
  869. @cindex Permissions, general
  870. @c FIXME: we need to somehow reflect "permissions in
  871. @c repository" versus "permissions in working
  872. @c directory" in the index entries.
  873. @cindex Group, UNIX file permissions, in repository
  874. @cindex Read-only files, in repository
  875. All @samp{,v} files are created read-only, and you
  876. should not change the permission of those files. The
  877. directories inside the repository should be writable by
  878. the persons that have permission to modify the files in
  879. each directory. This normally means that you must
  880. create a UNIX group (see group(5)) consisting of the
  881. persons that are to edit the files in a project, and
  882. set up the repository so that it is that group that
  883. owns the directory.
  884. (On some systems, you also need to set the set-group-ID-on-execution bit
  885. on the repository directories (see chmod(1)) so that newly-created files
  886. and directories get the group-ID of the parent directory rather than
  887. that of the current process.)
  888. @c See also comment in commitinfo node regarding cases
  889. @c which are really awkward with unix groups.
  890. This means that you can only control access to files on
  891. a per-directory basis.
  892. Note that users must also have write access to check
  893. out files, because @sc{cvs} needs to create lock files
  894. (@pxref{Concurrency}). You can use LockDir in CVSROOT/config
  895. to put the lock files somewhere other than in the repository
  896. if you want to allow read-only access to some directories
  897. (@pxref{config}).
  898. @c CVS seems to use CVSUMASK in picking permissions for
  899. @c val-tags, but maybe we should say more about this.
  900. @c Like val-tags gets created by someone who doesn't
  901. @c have CVSUMASK set right?
  902. @cindex CVSROOT/val-tags file, and read-only access to projects
  903. @cindex val-tags file, and read-only access to projects
  904. Also note that users must have write access to the
  905. @file{CVSROOT/val-tags} file. @sc{cvs} uses it to keep
  906. track of what tags are valid tag names (it is sometimes
  907. updated when tags are used, as well as when they are
  908. created).
  909. Each @sc{rcs} file will be owned by the user who last
  910. checked it in. This has little significance; what
  911. really matters is who owns the directories.
  912. @cindex CVSUMASK, environment variable
  913. @cindex Umask, for repository files
  914. @sc{cvs} tries to set up reasonable file permissions
  915. for new directories that are added inside the tree, but
  916. you must fix the permissions manually when a new
  917. directory should have different permissions than its
  918. parent directory. If you set the @code{CVSUMASK}
  919. environment variable, that will control the file
  920. permissions which @sc{cvs} uses in creating directories
  921. and/or files in the repository. @code{CVSUMASK} does
  922. not affect the file permissions in the working
  923. directory; such files have the permissions which are
  924. typical for newly created files, except that sometimes
  925. @sc{cvs} creates them read-only (see the sections on
  926. watches, @ref{Setting a watch}; -r, @ref{Global
  927. options}; or @code{CVSREAD}, @ref{Environment variables}).
  928. @c FIXME: Need more discussion of which
  929. @c group should own the file in the repository.
  930. @c Include a somewhat detailed example of the usual
  931. @c case where CVSUMASK is 007, the developers are all
  932. @c in a group, and that group owns stuff in the
  933. @c repository. Need to talk about group ownership of
  934. @c newly-created directories/files (on some unices,
  935. @c such as SunOS4, setting the setgid bit on the
  936. @c directories will make files inherit the directory's
  937. @c group. On other unices, your mileage may vary. I
  938. @c can't remember what POSIX says about this, if
  939. @c anything).
  940. Note that using the client/server @sc{cvs}
  941. (@pxref{Remote repositories}), there is no good way to
  942. set @code{CVSUMASK}; the setting on the client machine
  943. has no effect. If you are connecting with @code{rsh}, you
  944. can set @code{CVSUMASK} in @file{.bashrc} or @file{.cshrc}, as
  945. described in the documentation for your operating
  946. system. This behavior might change in future versions
  947. of @sc{cvs}; do not rely on the setting of
  948. @code{CVSUMASK} on the client having no effect.
  949. @c FIXME: need to explain what a umask is or cite
  950. @c someplace which does.
  951. @c
  952. @c There is also a larger (largely separate) issue
  953. @c about the meaning of CVSUMASK in a non-unix context.
  954. @c For example, whether there is
  955. @c an equivalent which fits better into other
  956. @c protection schemes like POSIX.6, VMS, &c.
  957. @c
  958. @c FIXME: Need one place which discusses this
  959. @c read-only files thing. Why would one use -r or
  960. @c CVSREAD? Why would one use watches? How do they
  961. @c interact?
  962. @c
  963. @c FIXME: We need to state
  964. @c whether using CVSUMASK removes the need for manually
  965. @c fixing permissions (in fact, if we are going to mention
  966. @c manually fixing permission, we better document a lot
  967. @c better just what we mean by "fix").
  968. Using pserver, you will generally need stricter
  969. permissions on the @sc{cvsroot} directory and
  970. directories above it in the tree; see @ref{Password
  971. authentication security}.
  972. @cindex Setuid
  973. @cindex Setgid
  974. @cindex Security, setuid
  975. @cindex Installed images (VMS)
  976. Some operating systems have features which allow a
  977. particular program to run with the ability to perform
  978. operations which the caller of the program could not.
  979. For example, the set user ID (setuid) or set group ID
  980. (setgid) features of unix or the installed image
  981. feature of VMS. @sc{cvs} was not written to use such
  982. features and therefore attempting to install @sc{cvs} in
  983. this fashion will provide protection against only
  984. accidental lapses; anyone who is trying to circumvent
  985. the measure will be able to do so, and depending on how
  986. you have set it up may gain access to more than just
  987. @sc{cvs}. You may wish to instead consider pserver. It
  988. shares some of the same attributes, in terms of
  989. possibly providing a false sense of security or opening
  990. security holes wider than the ones you are trying to
  991. fix, so read the documentation on pserver security
  992. carefully if you are considering this option
  993. (@ref{Password authentication security}).
  994. @node Windows permissions
  995. @subsection File Permission issues specific to Windows
  996. @cindex Windows, and permissions
  997. @cindex File permissions, Windows-specific
  998. @cindex Permissions, Windows-specific
  999. Some file permission issues are specific to Windows
  1000. operating systems (Windows 95, Windows NT, and
  1001. presumably future operating systems in this family.
  1002. Some of the following might apply to OS/2 but I'm not
  1003. sure).
  1004. If you are using local @sc{cvs} and the repository is on a
  1005. networked file system which is served by the Samba SMB
  1006. server, some people have reported problems with
  1007. permissions. Enabling WRITE=YES in the samba
  1008. configuration is said to fix/workaround it.
  1009. Disclaimer: I haven't investigated enough to know the
  1010. implications of enabling that option, nor do I know
  1011. whether there is something which @sc{cvs} could be doing
  1012. differently in order to avoid the problem. If you find
  1013. something out, please let us know as described in
  1014. @ref{BUGS}.
  1015. @node Attic
  1016. @subsection The attic
  1017. @cindex Attic
  1018. You will notice that sometimes @sc{cvs} stores an
  1019. @sc{rcs} file in the @code{Attic}. For example, if the
  1020. @sc{cvsroot} is @file{/usr/local/cvsroot} and we are
  1021. talking about the file @file{backend.c} in the
  1022. directory @file{yoyodyne/tc}, then the file normally
  1023. would be in
  1024. @example
  1025. /usr/local/cvsroot/yoyodyne/tc/backend.c,v
  1026. @end example
  1027. @noindent
  1028. but if it goes in the attic, it would be in
  1029. @example
  1030. /usr/local/cvsroot/yoyodyne/tc/Attic/backend.c,v
  1031. @end example
  1032. @noindent
  1033. @cindex Dead state
  1034. instead. It should not matter from a user point of
  1035. view whether a file is in the attic; @sc{cvs} keeps
  1036. track of this and looks in the attic when it needs to.
  1037. But in case you want to know, the rule is that the RCS
  1038. file is stored in the attic if and only if the head
  1039. revision on the trunk has state @code{dead}. A
  1040. @code{dead} state means that file has been removed, or
  1041. never added, for that revision. For example, if you
  1042. add a file on a branch, it will have a trunk revision
  1043. in @code{dead} state, and a branch revision in a
  1044. non-@code{dead} state.
  1045. @c Probably should have some more concrete examples
  1046. @c here, or somewhere (not sure exactly how we should
  1047. @c arrange the discussion of the dead state, versus
  1048. @c discussion of the attic).
  1049. @node CVS in repository
  1050. @subsection The CVS directory in the repository
  1051. @cindex CVS directory, in repository
  1052. The @file{CVS} directory in each repository directory
  1053. contains information such as file attributes (in a file
  1054. called @file{CVS/fileattr}. In the
  1055. future additional files may be added to this directory,
  1056. so implementations should silently ignore additional
  1057. files.
  1058. This behavior is implemented only by @sc{cvs} 1.7 and
  1059. later; for details see @ref{Watches Compatibility}.
  1060. The format of the @file{fileattr} file is a series of entries
  1061. of the following form (where @samp{@{} and @samp{@}}
  1062. means the text between the braces can be repeated zero
  1063. or more times):
  1064. @var{ent-type} @var{filename} <tab> @var{attrname} = @var{attrval}
  1065. @{; @var{attrname} = @var{attrval}@} <linefeed>
  1066. @var{ent-type} is @samp{F} for a file, in which case the entry specifies the
  1067. attributes for that file.
  1068. @var{ent-type} is @samp{D},
  1069. and @var{filename} empty, to specify default attributes
  1070. to be used for newly added files.
  1071. Other @var{ent-type} are reserved for future expansion. @sc{cvs} 1.9 and older
  1072. will delete them any time it writes file attributes.
  1073. @sc{cvs} 1.10 and later will preserve them.
  1074. Note that the order of the lines is not significant;
  1075. a program writing the fileattr file may
  1076. rearrange them at its convenience.
  1077. There is currently no way of quoting tabs or line feeds in the
  1078. filename, @samp{=} in @var{attrname},
  1079. @samp{;} in @var{attrval}, etc. Note: some implementations also
  1080. don't handle a NUL character in any of the fields, but
  1081. implementations are encouraged to allow it.
  1082. By convention, @var{attrname} starting with @samp{_} is for an attribute given
  1083. special meaning by @sc{cvs}; other @var{attrname}s are for user-defined attributes
  1084. (or will be, once implementations start supporting user-defined attributes).
  1085. Built-in attributes:
  1086. @table @code
  1087. @item _watched
  1088. Present means the file is watched and should be checked out
  1089. read-only.
  1090. @item _watchers
  1091. Users with watches for this file. Value is
  1092. @var{watcher} > @var{type} @{ , @var{watcher} > @var{type} @}
  1093. where @var{watcher} is a username, and @var{type}
  1094. is zero or more of edit,unedit,commit separated by
  1095. @samp{+} (that is, nothing if none; there is no "none" or "all" keyword).
  1096. @item _editors
  1097. Users editing this file. Value is
  1098. @var{editor} > @var{val} @{ , @var{editor} > @var{val} @}
  1099. where @var{editor} is a username, and @var{val} is
  1100. @var{time}+@var{hostname}+@var{pathname}, where
  1101. @var{time} is when the @code{cvs edit} command (or
  1102. equivalent) happened,
  1103. and @var{hostname} and @var{pathname} are for the working directory.
  1104. @end table
  1105. Example:
  1106. @c FIXME: sanity.sh should contain a similar test case
  1107. @c so we can compare this example from something from
  1108. @c Real Life(TM). See cvsclient.texi (under Notify) for more
  1109. @c discussion of the date format of _editors.
  1110. @example
  1111. Ffile1 _watched=;_watchers=joe>edit,mary>commit
  1112. Ffile2 _watched=;_editors=sue>8 Jan 1975+workstn1+/home/sue/cvs
  1113. D _watched=
  1114. @end example
  1115. @noindent
  1116. means that the file @file{file1} should be checked out
  1117. read-only. Furthermore, joe is watching for edits and
  1118. mary is watching for commits. The file @file{file2}
  1119. should be checked out read-only; sue started editing it
  1120. on 8 Jan 1975 in the directory @file{/home/sue/cvs} on
  1121. the machine @code{workstn1}. Future files which are
  1122. added should be checked out read-only. To represent
  1123. this example here, we have shown a space after
  1124. @samp{D}, @samp{Ffile1}, and @samp{Ffile2}, but in fact
  1125. there must be a single tab character there and no spaces.
  1126. @node Locks
  1127. @subsection CVS locks in the repository
  1128. @cindex #cvs.rfl, technical details
  1129. @cindex #cvs.wfl, technical details
  1130. @cindex #cvs.lock, technical details
  1131. @cindex Locks, cvs, technical details
  1132. For an introduction to @sc{cvs} locks focusing on
  1133. user-visible behavior, see @ref{Concurrency}. The
  1134. following section is aimed at people who are writing
  1135. tools which want to access a @sc{cvs} repository without
  1136. interfering with other tools accessing the same
  1137. repository. If you find yourself confused by concepts
  1138. described here, like @dfn{read lock}, @dfn{write lock},
  1139. and @dfn{deadlock}, you might consult the literature on
  1140. operating systems or databases.
  1141. @cindex #cvs.tfl
  1142. Any file in the repository with a name starting
  1143. with @file{#cvs.rfl.} is a read lock. Any file in
  1144. the repository with a name starting with
  1145. @file{#cvs.wfl} is a write lock. Old versions of @sc{cvs}
  1146. (before @sc{cvs} 1.5) also created files with names starting
  1147. with @file{#cvs.tfl}, but they are not discussed here.
  1148. The directory @file{#cvs.lock} serves as a master
  1149. lock. That is, one must obtain this lock fi…