📄 locking-ui.txt
字号:
password: XXXX svn: error: 'foo.c' is locked by user 'harry'. $ svn unlock foo.c --force username: sally password: XXXX Lock on 'foo.c' has been broken. The --force option also accepts a URL, so that the lock can be released without a working copy. d. Stealing a lock "Stealing" a lock is a means of creating a lock when: - The path is locked by you, but you don't have a representation of the lock in your current working copy, or - The path is locked by someone else. In order to steal a lock, a user must be authenticated to the server. Use the --force option to the lock command to steal a lock. For example: $ svn lock foo.c username: sally password: XXXX svn: error: 'foo.c' is locked by user 'harry'. $ svn lock foo.c --force username: sally password: XXXX 'foo.c' locked by user 'sally'. Remember that the 'svn lock' command still requires that the target be up-to-date to succeed. e. Discovering/examining locks 1. seeing lock tokens in a working copy 'svn status' considers a lock token "interesting", and displays it using some new symbol, in a new column: $ svn status M foo.c M K bar.c A baz.c Note that K (locKed) is used instead of the more intuitive L, since L is already in use for another purpose. 2. seeing locks in a repository. 'svn status -u' adds out-of-date information from the server; in a similar manner, this command shows any locks that exist on the server: $ svn status -u M foo.c M K bar.c A * baz.c * file1 O file2 M B file3 M T file42 As with "svn status", the sixth column indicates lock state. The letters have the following meanings: ' ': No lock in either WC or repository. 'K': Locked in the WC and lock token valid in repository. 'O': No lock in WC, lock in repository. (Locked in Other WC.) 'B': Lock in WC, but no lock in repository. (Lock Broken.) 'T': Locked in WC, but locked with another token in repository. (Lock was sTolen.) 3. 'svn info', describes the attributes of a lock-token, if attached to a working object. If invoked on a URL, it displays information about any remote lock attached. $ svn info foo.c Path: foo.c Name: foo.c URL: http://..../ [...] Lock Token: 465610b1-33eb-0310-8a02-cae41507c13a Lock Owner: lundblad Lock Comment: Refactoring. Lock Creation Date: 2004-12-14 14:49:36 +0100 (Tue, 14 Dec 2004) $ svn info http://host/repos/file2 Path: /file2 Name: file2 URL: http://..../ [...] Lock Token: 465610b1-33eb-0310-8a02-cae41507c13b Lock Owner: fitz Lock Comment: Don't touch my file! Lock Creation Date: 2004-12-25 14:49:36 +0100 (Tue, 14 Dec 2004) 4. 'svn update' changes At the start of an update, the client reports any lock-tokens to the server. If a lock token has become "defunct", the client is instructed to destroy the lock token. A new column will be added to the update output to indicate removed lock tokens: svn up U path1 U path2 B path3 C B path4 In the above example, lock tokens for path3 and path4 were removed. Note that 'B' is used even if there is a new lock in the repository.III. New Server Behaviors A. Overview This section describes new server UIs for locking: two new hook scripts, a new 'svnlook' subcommand, and a new 'svnadmin' subcommand. B. Tracking locks The Subversion server holds the master list of all locks for a repository. It responds to client requests to create, release, break and steal locks. C. Enforcement During a commit, the server checks for locks the same way that it checks for out-of-dateness: $ svn commit Sending foo.c Sending bar.c svn: error: 'bar.c' is locked by user 'harry'. D. Configurable Mechanisms 1. New "pre-" hook scripts a. pre-lock Used to authorize lock creation. Invoked whenever a user creates a lock ('svn lock') or steals a lock ('svn lock --force'). If an administrator wants the locking feature completely disabled, just set this hook to always return failure. - input: REPOS, PATH, USER - successful exit means lock is allowed, else deny lock creation. - if path is already locked, hook script can deduce that USER is "stealing" the lock and decide what to do. b. pre-unlock Used to authorize lock releasing. Invoked whenever a user releases a lock ('svn unlock) or breaks a lock ('svn unlock' --force). - input: REPOS, PATH, USER - successful exit means release is allowed, else deny. - if path is already locked, hook script can deduce that USER is "breaking" the lock and decide what to do. 2. New "post-" hook scripts a. post-lock Used to report lock creation. Invoked whenever a user creates a lock ('svn lock') or steals a lock ('svn lock --force'). - input: REPOS, PATH, USER - exit code ignored - can be used to send email, collect statistics, etc. b. post-unlock Used to report lock release. Invoked whenever a user releases a lock ('svn unlock') or breaks a lock ('svn unlock --force'). - input: REPOS, PATH, USER - exit code ignored - can be used to send email, collect statistics, etc. E. Lock manipulation with svnadmin 1. Discovering locks A new 'svnlook listlocks' subcommand shows all current locks in a repository: $ svnlook listlocks /usr/local/svn/repos # harry Aug 16 15:13 /trunk/bar.c # sally Sep 07 09:30 /trunk/doc/foo.doc 2. Unconditional release of locks A new 'svnadmin unlock' subcommand to unconditionally release a lock. Note that this command circumvents hook scripts, much like other svnadmin actions: $ svnadmin unlock /usr/local/svn/repos /trunk/doc/foo.doc Lock on '/trunk/doc/foo.doc' has been released.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -