📄 config_file.c
字号:
/** Ensure that the `servers' file exists. **/ SVN_ERR(svn_config__user_config_path (config_dir, &path, SVN_CONFIG_CATEGORY_SERVERS, pool)); if (! path) /* highly unlikely, since a previous call succeeded */ return SVN_NO_ERROR; err = svn_io_check_path(path, &kind, pool); if (err) { svn_error_clear(err); return SVN_NO_ERROR; } if (kind == svn_node_none) { apr_file_t *f; const char *contents = "### This file specifies server-specific protocol parameters," APR_EOL_STR "### including HTTP proxy information, and HTTP timeout settings." APR_EOL_STR "###" APR_EOL_STR "### The currently defined server options are:" APR_EOL_STR "### http-proxy-host Proxy host for HTTP connection" APR_EOL_STR "### http-proxy-port Port number of proxy host service" APR_EOL_STR "### http-proxy-username Username for auth to proxy service" APR_EOL_STR "### http-proxy-password Password for auth to proxy service" APR_EOL_STR "### http-proxy-exceptions List of sites that do not use proxy" APR_EOL_STR "### http-timeout Timeout for HTTP requests in seconds" APR_EOL_STR "### http-compression Whether to compress HTTP requests" APR_EOL_STR "### neon-debug-mask Debug mask for Neon HTTP library" APR_EOL_STR "### ssl-authority-files List of files, each of a trusted CAs" APR_EOL_STR "### ssl-trust-default-ca Trust the system 'default' CAs" APR_EOL_STR "### ssl-client-cert-file PKCS#12 format client " "certificate file" APR_EOL_STR "### ssl-client-cert-password Client Key password, if needed." APR_EOL_STR "###" APR_EOL_STR "### HTTP timeouts, if given, are specified in seconds. A timeout" APR_EOL_STR "### of 0, i.e. zero, causes a builtin default to be used." APR_EOL_STR "###" APR_EOL_STR "### The commented-out examples below are intended only to" APR_EOL_STR "### demonstrate how to use this file; any resemblance to actual" APR_EOL_STR "### servers, living or dead, is entirely coincidental." APR_EOL_STR APR_EOL_STR "### In this section, the URL of the repository you're trying to" APR_EOL_STR "### access is matched against the patterns on the right. If a" APR_EOL_STR "### match is found, the server info is from the section with the" APR_EOL_STR "### corresponding name." APR_EOL_STR APR_EOL_STR "[groups]" APR_EOL_STR "# group1 = *.collab.net" APR_EOL_STR "# othergroup = repository.blarggitywhoomph.com" APR_EOL_STR "# thirdgroup = *.example.com" APR_EOL_STR APR_EOL_STR "### Information for the first group:" APR_EOL_STR "# [group1]" APR_EOL_STR"# http-proxy-host = proxy1.some-domain-name.com" APR_EOL_STR "# http-proxy-port = 80" APR_EOL_STR "# http-proxy-username = blah" APR_EOL_STR "# http-proxy-password = doubleblah" APR_EOL_STR "# http-timeout = 60" APR_EOL_STR "# neon-debug-mask = 130" APR_EOL_STR "" APR_EOL_STR "### Information for the second group:" APR_EOL_STR "# [othergroup]" APR_EOL_STR "# http-proxy-host = proxy2.some-domain-name.com" APR_EOL_STR "# http-proxy-port = 9000" APR_EOL_STR "# No username and password, so use the defaults below." APR_EOL_STR "" APR_EOL_STR "### You can set default parameters in the 'global' section." APR_EOL_STR "### These parameters apply if no corresponding parameter is set in" APR_EOL_STR "### a specifically matched group as shown above. Thus, if you go" APR_EOL_STR "### through the same proxy server to reach every site on the" APR_EOL_STR "### Internet, you probably just want to put that server's" APR_EOL_STR "### information in the 'global' section and not bother with" APR_EOL_STR "### 'groups' or any other sections." APR_EOL_STR "###" APR_EOL_STR "### If you go through a proxy for all but a few sites, you can" APR_EOL_STR "### list those exceptions under 'http-proxy-exceptions'. This only" APR_EOL_STR "### overrides defaults, not explicitly matched server names." APR_EOL_STR "###" APR_EOL_STR "### 'ssl-authority-files' is a semicolon-delimited list of files," APR_EOL_STR "### each pointing to a PEM-encoded Certificate Authority (CA) " APR_EOL_STR "### SSL certificate. See details above for overriding security " APR_EOL_STR "### due to SSL." APR_EOL_STR "[global]" APR_EOL_STR "# http-proxy-exceptions = *.exception.com, www.internal-site.org" APR_EOL_STR "# http-proxy-host = defaultproxy.whatever.com" APR_EOL_STR "# http-proxy-port = 7000" APR_EOL_STR "# http-proxy-username = defaultusername" APR_EOL_STR "# http-proxy-password = defaultpassword" APR_EOL_STR "# http-compression = no" APR_EOL_STR "# No http-timeout, so just use the builtin default." APR_EOL_STR "# No neon-debug-mask, so neon debugging is disabled." APR_EOL_STR "# ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem" APR_EOL_STR; err = svn_io_file_open(&f, path, (APR_WRITE | APR_CREATE | APR_EXCL), APR_OS_DEFAULT, pool); if (! err) { SVN_ERR(svn_io_file_write_full(f, contents, strlen(contents), NULL, pool)); SVN_ERR(svn_io_file_close(f, pool)); } svn_error_clear(err); } /** Ensure that the `config' file exists. **/ SVN_ERR(svn_config__user_config_path (config_dir, &path, SVN_CONFIG_CATEGORY_CONFIG, pool)); if (! path) /* highly unlikely, since a previous call succeeded */ return SVN_NO_ERROR; err = svn_io_check_path(path, &kind, pool); if (err) { svn_error_clear(err); return SVN_NO_ERROR; } if (kind == svn_node_none) { apr_file_t *f; const char *contents = "### This file configures various client-side behaviors." APR_EOL_STR "###" APR_EOL_STR "### The commented-out examples below are intended to demonstrate" APR_EOL_STR "### how to use this file." APR_EOL_STR APR_EOL_STR "### Section for authentication and authorization customizations." APR_EOL_STR "[auth]" APR_EOL_STR "### Set store-passwords to 'no' to avoid storing passwords in the" APR_EOL_STR "### auth/ area of your config directory. It defaults to 'yes'." APR_EOL_STR "### Note that this option only prevents saving of *new* passwords;" APR_EOL_STR "### it doesn't invalidate existing passwords. (To do that, remove" APR_EOL_STR "### the cache files by hand as described in the Subversion book.)" APR_EOL_STR "# store-passwords = no" APR_EOL_STR "### Set store-auth-creds to 'no' to avoid storing any subversion" APR_EOL_STR "### credentials in the auth/ area of your config directory." APR_EOL_STR "### It defaults to 'yes'. Note that this option only prevents" APR_EOL_STR "### saving of *new* credentials; it doesn't invalidate existing" APR_EOL_STR "### caches. (To do that, remove the cache files by hand.)" APR_EOL_STR "# store-auth-creds = no" APR_EOL_STR APR_EOL_STR "### Section for configuring external helper applications." APR_EOL_STR "[helpers]" APR_EOL_STR "### Set editor to the command used to invoke your text editor." APR_EOL_STR "### This will override the environment variables that Subversion" APR_EOL_STR "### examines by default to find this information ($EDITOR, " APR_EOL_STR "### et al)." APR_EOL_STR "# editor-cmd = editor (vi, emacs, notepad, etc.)" APR_EOL_STR "### Set diff-cmd to the absolute path of your 'diff' program." APR_EOL_STR "### This will override the compile-time default, which is to use" APR_EOL_STR "### Subversion's internal diff implementation." APR_EOL_STR "# diff-cmd = diff_program (diff, gdiff, etc.)" APR_EOL_STR "### Set diff3-cmd to the absolute path of your 'diff3' program." APR_EOL_STR "### This will override the compile-time default, which is to use" APR_EOL_STR "### Subversion's internal diff3 implementation." APR_EOL_STR "# diff3-cmd = diff3_program (diff3, gdiff3, etc.)" APR_EOL_STR "### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3'" APR_EOL_STR "### program accepts the '--diff-program' option." APR_EOL_STR "# diff3-has-program-arg = [true | false]" APR_EOL_STR APR_EOL_STR "### Section for configuring tunnel agents." APR_EOL_STR "[tunnels]" APR_EOL_STR "### Configure svn protocol tunnel schemes here. By default, only" APR_EOL_STR "### the 'ssh' scheme is defined. You can define other schemes to" APR_EOL_STR "### be used with 'svn+scheme://hostname/path' URLs. A scheme" APR_EOL_STR "### definition is simply a command, optionally prefixed by an" APR_EOL_STR "### environment variable name which can override the command if it" APR_EOL_STR "### is defined. The command (or environment variable) may contain" APR_EOL_STR "### arguments, using standard shell quoting for arguments with" APR_EOL_STR "### spaces. The command will be invoked as:" APR_EOL_STR "### <command> <hostname> svnserve -t" APR_EOL_STR "### (If the URL includes a username, then the hostname will be" APR_EOL_STR "### passed to the tunnel agent as <user>@<hostname>.) If the" APR_EOL_STR "### built-in ssh scheme were not predefined, it could be defined" APR_EOL_STR "### as:" APR_EOL_STR "# ssh = $SVN_SSH ssh" APR_EOL_STR "### If you wanted to define a new 'rsh' scheme, to be used with" APR_EOL_STR "### 'svn+rsh:' URLs, you could do so as follows:" APR_EOL_STR "# rsh = rsh" APR_EOL_STR "### Or, if you wanted to specify a full path and arguments:" APR_EOL_STR "# rsh = /path/to/rsh -l myusername" APR_EOL_STR "### On Windows, if you are specifying a full path to a command," APR_EOL_STR "### use a forward slash (/) or a paired backslash (\\\\) as the" APR_EOL_STR "### path separator. A single backslash will be treated as an" APR_EOL_STR "### escape for the following character." APR_EOL_STR APR_EOL_STR "### Section for configuring miscelleneous Subversion options." APR_EOL_STR "[miscellany]" APR_EOL_STR "### Set global-ignores to a set of whitespace-delimited globs" APR_EOL_STR "### which Subversion will ignore in its 'status' output, and" APR_EOL_STR "### while importing or adding files and directories." APR_EOL_STR "# global-ignores = " SVN_CONFIG_DEFAULT_GLOBAL_IGNORES "" APR_EOL_STR "### Set log-encoding to the default encoding for log messages" APR_EOL_STR "# log-encoding = latin1" APR_EOL_STR "### Set use-commit-times to make checkout/update/switch/revert" APR_EOL_STR "### put last-committed timestamps on every file touched." APR_EOL_STR "# use-commit-times = yes" APR_EOL_STR "### Set no-unlock to prevent 'svn commit' from automatically" APR_EOL_STR "### releasing locks on files." APR_EOL_STR "# no-unlock = yes" APR_EOL_STR "### Set enable-auto-props to 'yes' to enable automatic properties" APR_EOL_STR "### for 'svn add' and 'svn import', it defaults to 'no'." APR_EOL_STR "### Automatic properties are defined in the section 'auto-props'." APR_EOL_STR "# enable-auto-props = yes" APR_EOL_STR APR_EOL_STR "### Section for configuring automatic properties." APR_EOL_STR "[auto-props]" APR_EOL_STR "### The format of the entries is:" APR_EOL_STR "### file-name-pattern = propname[=value][;propname[=value]...]" APR_EOL_STR "### The file-name-pattern can contain wildcards (such as '*' and" APR_EOL_STR "### '?'). All entries which match will be applied to the file." APR_EOL_STR "### Note that auto-props functionality must be enabled, which" APR_EOL_STR "### is typically done by setting the 'enable-auto-props' option." APR_EOL_STR "# *.c = svn:eol-style=native" APR_EOL_STR "# *.cpp = svn:eol-style=native" APR_EOL_STR "# *.h = svn:eol-style=native" APR_EOL_STR "# *.dsp = svn:eol-style=CRLF" APR_EOL_STR "# *.dsw = svn:eol-style=CRLF" APR_EOL_STR "# *.sh = svn:eol-style=native;svn:executable" APR_EOL_STR "# *.txt = svn:eol-style=native" APR_EOL_STR "# *.png = svn:mime-type=image/png" APR_EOL_STR "# *.jpg = svn:mime-type=image/jpeg" APR_EOL_STR "# Makefile = svn:eol-style=native" APR_EOL_STR APR_EOL_STR; err = svn_io_file_open(&f, path, (APR_WRITE | APR_CREATE | APR_EXCL), APR_OS_DEFAULT, pool); if (! err) { SVN_ERR(svn_io_file_write_full(f, contents, strlen(contents), NULL, pool)); SVN_ERR(svn_io_file_close(f, pool)); } svn_error_clear(err); } return SVN_NO_ERROR;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -