Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 40 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
40
Dung lượng
1,44 MB
Nội dung
tunnel-user NAME Used in conjunction with the tunnel option; tells svnserve to assume that NAME is the authenticated user, rather than the UID of the svnserve process. Useful for users wishing to share a single system account over SSH, but maintaining separate commit identities. threads (-T) When running in daemon mode, causes svnserve to spawn a thread instead of a process for each connection (e.g. for when running on Windows). The svnserve process still back- grounds itself at startup time. listen-once (-X) Causes svnserve to accept one connection on the svn port, serve it, and exit. This option is mainly useful for debugging. svnversion Subversion Complete Reference 309 Name svnversion — Summarize the local revision(s) of a working copy. Synopsis svnversion [OPTIONS] [WC_PATH [TRAIL_URL]] Description svnversion is a program for summarizing the revision mixture of a working copy. The resultant revision number, or revision range, is written to standard output. It's common to use this output in your build process when defining the version number of your program. TRAIL_URL, if present, is the trailing portion of the URL used to determine if WC_PATH itself is switched (detection of switches within WC_PATH does not rely on TRAIL_URL). When WC_PATH is not defined, the current directory will be used as the working copy path. TRAIL_URL cannot be defined if WC_PATH is not explicitly given. Options Like svnserve, svnversion has no subcommands, it only has options. no-newline (-n) Omit the usual trailing newline from the output. committed (-c) Use the last-changed revisions rather than the current (i.e., highest locally available) revi- sions. help (-h) Print a help summary. version Print the version of svnversion and exit with no error. Examples If the working copy is all at the same revision (for example, immediately after an update), then that revision is printed out: $ svnversion 4168 You can add TRAIL_URL to make sure that the working copy is not switched from what you expect. Note that the WC_PATH is required in this command: $ svnversion . /repos/svn/trunk Subversion Complete Reference 310 4168 For a mixed-revision working copy, the range of revisions present is printed: $ svnversion 4123:4168 If the working copy contains modifications, a trailing "M" is added: $ svnversion 4168M If the working copy is switched, a trailing "S" is added: $ svnversion 4168S Thus, here is a mixed-revision, switched working copy containing some local modifications: $ svnversion 4212:4168MS If invoked on a directory that is not a working copy, svnversion assumes it is an exported working copy and prints "exported": $ svnversion exported mod_dav_svn Subversion Complete Reference 311 Name mod_dav_svn Configuration Directives — Apache configuration directives for serving Subver- sion repositories through Apache HTTP Server. Description This section briefly describes each of the Subversion Apache configuration directives. For an in-depth description of configuring Apache with Subversion, see the section called “httpd, the Apache HTTP server”.) Directives DAV svn This directive must be included in any Directory or Location block for a Subversion repository. It tells httpd to use the Subversion backend for mod_dav to handle all requests. SVNAutoversioning On This directive allows write requests from WebDAV clients to result in automatic commits. A generic log message is auto-generated and attached to each revision. If you enable Autoversioning, you'll likely want to set ModMimeUsePathInfo On so that mod_mime can set svn:mime-type to the correct mime-type automatically (as best as mod_mime is able to, of course). For more information, see Appendix C, WebDAV and Autoversioning SVNPath This directive specifies the location in the filesystem for a Subversion repository's files. In a configuration block for a Subversion repository, either this directive or SVNParentPath must be present, but not both. SVNSpecialURI Specifies the URI component (namespace) for special Subversion resources. The default is “!svn”, and most administrators will never use this directive. Only set this if there is a pressing need to have a file named !svn in your repository. If you change this on a server already in use, it will break all of the outstanding working copies and your users will hunt you down with pitchforks and flaming torches. SVNReposName Specifies the name of a Subversion repository for use in HTTP GET responses. This value will be prepended to the title of all directory listings (which are served when you navigate to a Subversion repository with a web browser). This directive is optional. SVNIndexXSLT Specifies the URI of an XSL transformation for directory indexes. This directive is optional. SVNParentPath Specifies the location in the filesystem of a parent directory whose child directories are Subversion repositories. In a configuration block for a Subversion repository, either this dir- ective or SVNPath must be present, but not both. SVNPathAuthz Control path-based authorization by enabling or disabling subrequests. See the section called “Disabling Path-based Checks” for details. Subversion Complete Reference 312 1 As of this writing, symbolic links are indeed the only “special” objects. But there might be more in future releases of Subversion. Subversion properties Subversion allows users to invent arbitrarily-named versioned properties on files and director- ies, as well as unversioned properties on revisions. The only restriction is on properties whose names begin with svn: (those are reserved for Subversion's own use). While these properties may be set by users to control Subversion's behavior, users may not invent new svn: proper- ties. Versioned Properties svn:executable If present on a file, the client will make the file executable in Unix-hosted working copies. See the section called “File Executability”. svn:mime-type If present on a file, the value indicates the file's mime-type. This allows the client to decide whether line-based contextual merging is safe to perform during updates, and can also af- fect how the file behaves when fetched via web browser. See the section called “File Con- tent Type”. svn:ignore If present on a directory, the value is a list of unversioned file patterns to be ignored by svn status and other subcommands. See the section called “Ignoring Unversioned Items” svn:keywords If present on a file, the value tells the client how to expand particular keywords within the file. See the section called “Keyword Substitution”. svn:eol-style If present on a file, the value tells the client how to manipulate the file's line-endings in the working copy, and in exported trees. See the section called “End-of-Line Character Se- quences” and svn export. svn:externals If present on a directory, the value is a multi-line list of other paths and URLs the client should check out. See the section called “Externals Definitions”. svn:special If present on a file, indicates that the file is not an ordinary file, but a symbolic link or other special object 1 . svn:needs-lock If present on a file, tells the client to make the file read-only in the working copy, as a re- minder that the file should be locked before editing begins. See the section called “Lock Communication”. Unversioned Properties svn:author If present, contains the authenticated username of the person who created the revision. (If not present, then the revision was committed anonymously.) Subversion Complete Reference 313 svn:date Contains the UTC time the revision was created, in ISO 8601 format. The value comes from the server machine's clock, not the client's. svn:log Contains the log message describing the revision. svn:autoversioned If present, the revision was created via the autoversioning feature. See the section called “Autoversioning”. Repository Hooks Subversion Complete Reference 314 Name start-commit — Notification of the beginning of a commit. Description The start-commit hook is run before the commit transaction is even created. It is typically used to decide if the user has commit privileges at all. If the start-commit hook program returns a non-zero exit value, the commit is stopped before the commit transaction is even created, and anything printed to stderr is marshalled back to the client. Input Parameter(s) The command-line arguments passed to the hook program, in order, are: 1. repository path 2. authenticated username attempting the commit Common Uses access control Subversion Complete Reference 315 Name pre-commit — Notification just prior to commit completion. Description The pre-commit hook is run just before a commit transaction is promoted to a new revision. Typically, this hook is used to protect against commits that are disallowed due to content or location (for example, your site might require that all commits to a certain branch include a tick- et number from the bug tracker, or that the incoming log message is non-empty). If the pre-commit hook program returns a non-zero exit value, the commit is aborted, the com- mit transaction is removed, and anything printed to stderr is marshalled back to the client. Input Parameter(s) The command-line arguments passed to the hook program, in order, are: 1. repository path 2. commit transaction name Common Uses change validation and control Subversion Complete Reference 316 Name post-commit — Notification of a successful commit. Description The post-commit hook is run after the transaction is committed, and a new revision created. Most people use this hook to send out descriptive emails about the commit or to notify some other tool (such as an issue tracker) that a commit has happened. Some configurations also use this hook to trigger backup processes. The output from, and exit value returned by the post-commit hook program are ignored. Input Parameter(s) The command-line arguments passed to the hook program, in order, are: 1. repository path 2. revision number created by the commit Common Uses commit notification, tool integration Subversion Complete Reference 317 Name pre-revprop-change — Notification of a revision property change attempt. Description The pre-revprop-change hook is run immediately prior to the modification of a revision property when performed outside the scope of a normal commit. Unlike the other hooks, the default state of this one is to deny the proposed action. The hook must actually exist and return a zero exit value before a revision property modification can happen. If the pre-revprop-change hook doesn't exist, isn't executable, or returns a non-zero exit value, no change to the property will be made, and anything printed to stderr is marshalled back to the client. Input Parameter(s) The command-line arguments passed to the hook program, in order, are: 1. repository path 2. revision whose property is about to be modified 3. authenticated username attempting the propchange 4. name of the property changed 5. change description: A (added), D (deleted), or M (modified) Additionally, Subversion passes to the hook program via standard input the proposed value of the property. Common Uses access control, change validation and control Subversion Complete Reference 318 [...]... trunk See our discussion of Subversion' s branching and tagging model for the reasoning behind this 324 Subversion Quick-Start Guide $ svn checkout http://svn.collab.net/repos/svn/trunk subversion A subversion/ HACKING A subversion/ INSTALL A subversion/ README A subversion/ autogen.sh A subversion/ build.conf … The above command will create a working copy of the latest (unreleased) Subversion source code into... you can also get the Subversion source code from the Subversion repository in which it lives Obviously, you'll need to already have a Subversion client on hand to do this But once you do, you can check out a working copy of the Subversion source repository from http://svn.collab.net/repos/svn/trunk/: 1 1 Note that the URL checked out in the example above ends not with svn, but with a subdirectory thereof... both CVS and Subversion, then you should read Chapter 1, Fundamental Concepts before going any further Installing Subversion Subversion is built on a portability layer called APR—the Apache Portable Runtime library The APR library provides all the interfaces that Subversion needs to function on different operating systems: disk access, network access, memory management, and so on While Subversion is... specification The hope was that the Subversion server module (mod_dav_svn) would eventually evolve into an open-source DeltaV reference implementation Unfortunately, DeltaV has a very specific versioning model that doesn't quite line up with Subversion' s model Some concepts were mappable, others were not 334 WebDAV and Autoversioning What does this mean, then? First, the Subversion client is not a fully-implemented... interoperate with Autoversioning While the Subversion client is not a full DeltaV client, nor the Subversion server a full DeltaV server, there's still a glimmer of WebDAV interoperability to be happy about: it's called autoversioning Autoversioning is an optional feature defined in the DeltaV standard A typical DeltaV server will reject an ignorant WebDAV client attempting to do a PUT to a file that's under version. .. them Meanwhile, the server is automatically versioning everything Any administrator (or knowledgeable user) can still use a Subversion client to search history and retrieve older versions of data This scenario isn't fiction: it's real and it works, as of Subversion 1.2 and later To activate autoversioning in mod_dav_svn, use the SVNAutoversioning directive within the httpd.conf Location block, like... under version control Resource is missing or incomplete (removed by another tool than Subversion) For a more detailed discussion of svn status, see the section called “See an overview of your changes” Update svn update updates your working copy, and only prints information about files that it updates Subversion has combined the CVS P and U codes into just U When a merge or conflict occurs, Subversion. .. not attempt to do so for binary files To determine whether a contextual merge is possible, Subversion examines the svn:mime-type property If the file has no svn:mime-type property, or has a mime-type that is textual (e.g text/*), Subversion assumes it is text Otherwise, Subversion assumes the file is binary Subversion also helps users by running a binary-detection algorithm in the svn import and svn... by WebDAV servers If you use Apache as your Subversion network server, then to some extent you are also running a WebDAV server This appendix gives some background on the nature of this protocol, how Subversion uses it, and how well Subversion interoperates with other software that is WebDAV-aware What is WebDAV? DAV stands for “Distributed Authoring and Versioning” RFC 2518 defines a set of concepts... any application It does mean, however, that like Apache, Subversion clients and servers run on any operating system that the Apache httpd server runs on: Windows, Linux, all flavors of BSD, Mac OS X, Netware, and others The easiest way to get Subversion is to download a binary package built for your operating system Subversion' s website (http:/ /subversion. tigris.org) often has these packages available . the Subversion source repository from http://svn.collab.net/repos/svn/trunk/: 1 324 $ svn checkout http://svn.collab.net/repos/svn/trunk subversion A subversion/ HACKING A subversion/ INSTALL A subversion/ README A. subversion/ README A subversion/ autogen.sh A subversion/ build.conf … The above command will create a working copy of the latest (unreleased) Subversion source code into a subdirectory named subversion. of version control or to the “copy-modify-merge” model used by both CVS and Subversion, then you should read Chapter 1, Funda- mental Concepts before going any further. Installing Subversion Subversion