当前位置: 首页 > 工具软件 > SVN2Log > 使用案例 >

[svn]log命令

沈高峻
2023-12-01
0.svn-log命令参数及说明
svn help log

wangyetao@linux_u1604:~/LinuxRoom/PROJECT_CODE_PHP/cfzx_mobile/cfzx$ svn help log
log: Show the log messages for a set of revision(s) and/or path(s).
usage: 1. log [PATH][@REV]
       2. log URL[@REV] [PATH...]

  1. Print the log messages for the URL corresponding to PATH
     (default: '.'). If specified, REV is the revision in which the
     URL is first looked up, and the default revision range is REV:1.
     If REV is not specified, the default revision range is BASE:1,
     since the URL might not exist in the HEAD revision.

  2. Print the log messages for the PATHs (default: '.') under URL.
     If specified, REV is the revision in which the URL is first
     looked up, and the default revision range is REV:1; otherwise,
     the URL is looked up in HEAD, and the default revision range is
     HEAD:1.

  Multiple '-c' or '-r' options may be specified (but not a
  combination of '-c' and '-r' options), and mixing of forward and
  reverse ranges is allowed.

  With -v, also print all affected paths with each log message.
  With -q, don't print the log message body itself (note that this is
  compatible with -v).

  Each log message is printed just once, even if more than one of the
  affected paths for that revision were explicitly requested.  Logs
  follow copy history by default.  Use --stop-on-copy to disable this
  behavior, which can be useful for determining branchpoints.

  The --depth option is only valid in combination with the --diff option
  and limits the scope of the displayed diff to the specified depth.

  If the --search option is used, log messages are displayed only if the
  provided search pattern matches any of the author, date, log message
  text (unless --quiet is used), or, if the --verbose option is also
  provided, a changed path.
  The search pattern may include "glob syntax" wildcards:
      ?      matches any single character
      *      matches a sequence of arbitrary characters
      [abc]  matches any of the characters listed inside the brackets
  If multiple --search options are provided, a log message is shown if
  it matches any of the provided search patterns. If the --search-and
  option is used, that option's argument is combined with the pattern
  from the previous --search or --search-and option, and a log message
  is shown only if it matches the combined search pattern.
  If --limit is used in combination with --search, --limit restricts the
  number of log messages searched, rather than restricting the output
  to a particular number of matching log messages.

  Examples:

    Show the latest 5 log messages for the current working copy
    directory and display paths changed in each commit:
      svn log -l 5 -v

    Show the log for bar.c as of revision 42:
      svn log bar.c@42

    Show log messages and diffs for each commit to foo.c:
      svn log --diff http://www.example.com/repo/project/foo.c
    (Because the above command uses a full URL it does not require
     a working copy.)

    Show log messages for the children foo.c and bar.c of the directory
    '/trunk' as it appeared in revision 50, using the ^/ URL shortcut:
      svn log ^/trunk@50 foo.c bar.c

    Show the log messages for any incoming changes to foo.c during the
    next 'svn update':
      svn log -r BASE:HEAD foo.c

    Show the log message for the revision in which /branches/foo
    was created:
      svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo

有效选项:
  -r [--revision] ARG      : ARG (一些命令也接受ARG1:ARG2范围)
                             版本参数可以是如下之一: 
                                NUMBER       版本号
                                '{' DATE '}' 在指定时间以后的版本
                                'HEAD'       版本库中的最新版本
                                'BASE'       工作副本的基线版本
                                'COMMITTED'  最后提交或基线之前
                                'PREV'       COMMITTED的前一版本
  -c [--change] ARG        : 版本 ARG 引起的改变
  -q [--quiet]             : do not print the log message
  -v [--verbose]           : also print all affected paths
  -g [--use-merge-history] : 从合并历史使用/显示额外信息
  --targets ARG            : 传递文件 ARG 内容为附件参数
  --stop-on-copy           : 查看历史不要跨越不同的副本
  --incremental            : 给予适合串联的输出
  --xml                    : 输出为 XML
  -l [--limit] ARG         : 日值项最大值
  --with-all-revprops      : 获取所有版本属性
  --with-no-revprops       : 没有找回版本属性
  --with-revprop ARG       : 获取版本属性 ARG
  --depth ARG              : 限制操作深度是 ARG ('empty', 'files',
                             'immediates', 或 'infinity')
  --diff                   : 产生差异输出
  --diff-cmd ARG           : 使用 ARG 作为比较命令
  --internal-diff          : 覆盖配置文件中指定的 diff-cmd
  -x [--extensions] ARG    : Specify differencing options for external diff or
                             internal diff or blame. Default: '-u'. Options are
                             separated by spaces. Internal diff and blame take:
                               -u, --unified: Show 3 lines of unified context
                               -b, --ignore-space-change: Ignore changes in
                                 amount of white space
                               -w, --ignore-all-space: Ignore all white space
                               --ignore-eol-style: Ignore changes in EOL style
                               -U ARG, --context ARG: Show ARG lines of context
                               -p, --show-c-function: Show C function name
  --search ARG             : use ARG as search pattern (glob syntax)
  --search-and ARG         : combine ARG with the previous search pattern

全局选项:
  --username ARG           : 指定用户名称 ARG
  --password ARG           : specify a password ARG (caution: on many operating
                             systems, other users will be able to see this)
  --no-auth-cache          : 不要缓存用户认证令牌
  --non-interactive        : do no interactive prompting (default is to prompt
                             only if standard input is a terminal device)
  --force-interactive      : do interactive prompting even if standard input
                             is not a terminal device
  --trust-server-cert      : deprecated; same as
                             --trust-server-cert-failures=unknown-ca
  --trust-server-cert-failures ARG : with --non-interactive, accept SSL server
                             certificates with failures; ARG is comma-separated
                             list of 'unknown-ca' (Unknown Authority),
                             'cn-mismatch' (Hostname mismatch), 'expired'
                             (Expired certificate), 'not-yet-valid' (Not yet
                             valid certificate) and 'other' (all other not
                             separately classified certificate errors).
  --config-dir ARG         : 从目录 ARG 读取用户配置文件
  --config-option ARG      : 以下属格式设置用户配置选项:
                                 FILE:SECTION:OPTION=[VALUE]
                             例如:
                                 servers:global:http-library=serf

wangyetao@linux_u1604:~/LinuxRoom/PROJECT_CODE_PHP/cfzx_mobile/cfzx$ 



1.查看指定用户名的日志记录 
svn log | sed -n '/USERNAME/,/--$/ p'
svn log -l 10 | sed -n '/wangyetao/,/-----$/ p'

wangyetao@linux_u1604:~/LinuxRoom/PROJECT_CODE_PHP/cfzx_mobile/cfzx$ svn log | sed -n '/wangyetao/,/--$/ p'
r2777 | wangyetao | 2018-03-20 18:51:25 +0800 (二, 2018-03-20) | 2 行

;

------------------------------------------------------------------------
r2773 | wangyetao | 2018-03-20 18:40:20 +0800 (二, 2018-03-20) | 2 行

;

------------------------------------------------------------------------
r2772 | wangyetao | 2018-03-20 18:39:39 +0800 (二, 2018-03-20) | 2 行

;

------------------------------------------------------------------------
r2763 | wangyetao | 2018-03-20 17:37:32 +0800 (二, 2018-03-20) | 2 行

;

------------------------------------------------------------------------
r2762 | wangyetao | 2018-03-20 17:24:10 +0800 (二, 2018-03-20) | 2 行

;
此处省略n条日志记录...............

wangyetao@linux_u1604:~/LinuxRoom/PROJECT_CODE_PHP/cfzx$ svn log -l 10 | sed -n '/wangyetao/,/-----$/ p' 
r5267 | wangyetao | 2018-03-21 17:21:57 +0800 (三, 2018-03-21) | 2 行

;

------------------------------------------------------------------------
r5265 | wangyetao | 2018-03-21 17:07:42 +0800 (三, 2018-03-21) | 2 行

;

------------------------------------------------------------------------
r5262 | wangyetao | 2018-03-21 16:45:14 +0800 (三, 2018-03-21) | 2 行

;

------------------------------------------------------------------------
r5261 | wangyetao | 2018-03-21 16:44:44 +0800 (三, 2018-03-21) | 2 行

;

------------------------------------------------------------------------
wangyetao@linux_u1604:~/LinuxRoom/PROJECT_CODE_PHP/cfzx$ 



2.查看版本库最近n条日志记录 
svn log -l N

wangyetao@linux_u1604:~/LinuxRoom/PROJECT_CODE_PHP/cfzx_mobile/cfzx$ svn log -l 3
------------------------------------------------------------------------
r2914 | wangyetao | 2018-03-21 17:42:26 +0800 (三, 2018-03-21) | 2 行

;

------------------------------------------------------------------------
r2913 | zhangzhigang | 2018-03-21 17:40:24 +0800 (三, 2018-03-21) | 1 行


------------------------------------------------------------------------
r2912 | huangpei | 2018-03-21 17:39:12 +0800 (三, 2018-03-21) | 1 行


------------------------------------------------------------------------



 类似资料: