📄 main.c
字号:
" svn:externals - A newline separated list of module specifiers,\n" " each of which consists of a relative directory path, optional\n" " revision flags, and an URL. For example\n" " foo http://example.com/repos/zig\n" " foo/bar -r 1234 http://example.com/repos/zag\n" " svn:needs-lock - If present, indicates that the file should be locked\n" " before it is modified. Makes the working copy file read-only\n" " when it is not locked.\n" " The svn:keywords, svn:executable, svn:eol-style, svn:mime-type and\n" " svn:needs-lock properties cannot be set on a directory. A non-recursive\n" " attempt will fail, and a recursive attempt will set the property\n" " only on the file children of the directory.\n"), {'F', svn_cl__encoding_opt, 'q', 'r', svn_cl__targets_opt, 'R', svn_cl__revprop_opt, SVN_CL__AUTH_OPTIONS, svn_cl__force_opt, svn_cl__config_dir_opt}, {{'F', N_("read property value from file ARG")}} }, { "resolved", svn_cl__resolved, {0}, N_ ("Remove 'conflicted' state on working copy files or directories.\n" "usage: resolved PATH...\n" "\n" " Note: this subcommand does not semantically resolve conflicts or\n" " remove conflict markers; it merely removes the conflict-related\n" " artifact files and allows PATH to be committed again.\n"), {svn_cl__targets_opt, 'R', 'q', svn_cl__config_dir_opt} }, { "revert", svn_cl__revert, {0}, N_ ("Restore pristine working copy file (undo most local edits).\n" "usage: revert PATH...\n" "\n" " Note: this subcommand does not require network access, and resolves\n" " any conflicted states. However, it does not restore removed directories.\n"), {svn_cl__targets_opt, 'R', 'q', svn_cl__config_dir_opt} }, { "status", svn_cl__status, {"stat", "st"}, N_ ("Print the status of working copy files and directories.\n" "usage: status [PATH...]\n" "\n" " With no args, print only locally modified items (no network access).\n" " With -u, add working revision and server out-of-date information.\n" " With -v, print full revision information on every item.\n" "\n" " The first six columns in the output are each one character wide:\n" " First column: Says if item was added, deleted, or otherwise changed\n" " ' ' no modifications\n" " 'A' Added\n" " 'C' Conflicted\n" " 'D' Deleted\n" " 'I' Ignored\n" " 'M' Modified\n" " 'R' Replaced\n" " 'X' item is unversioned, but is used by an externals definition\n" " '?' item is not under version control\n" " '!' item is missing (removed by non-svn command) or incomplete\n" " '~' versioned item obstructed by some item of a different kind\n" " Second column: Modifications of a file's or directory's properties\n" " ' ' no modifications\n" " 'C' Conflicted\n" " 'M' Modified\n" " Third column: Whether the working copy directory is locked\n" " ' ' not locked\n" " 'L' locked\n" " Fourth column: Scheduled commit will contain addition-with-history\n" " ' ' no history scheduled with commit\n" " '+' history scheduled with commit\n" " Fifth column: Whether the item is switched relative to its parent\n" " ' ' normal\n" " 'S' switched\n" " Sixth column: Repository lock token\n" " (without -u)\n" " ' ' no lock token\n" " 'K' lock token present\n" " (with -u)\n" " ' ' not locked in repository, no lock token\n" " 'K' locked in repository, lock toKen present\n" " 'O' locked in repository, lock token in some Other working copy\n" " 'T' locked in repository, lock token present but sTolen\n" " 'B' not locked in repository, lock token present but Broken\n" "\n" " The out-of-date information appears in the eighth column (with -u):\n" " '*' a newer revision exists on the server\n" " ' ' the working copy is up to date\n" "\n" " Remaining fields are variable width and delimited by spaces:\n" " The working revision (with -u or -v)\n" " The last committed revision and last committed author (with -v)\n" " The working copy path is always the final field, so it can\n" " include spaces.\n" "\n" " Example output:\n" " svn status wc\n" " M wc/bar.c\n" " A + wc/qax.c\n" "\n" " svn status -u wc\n" " M 965 wc/bar.c\n" " * 965 wc/foo.c\n" " A + 965 wc/qax.c\n" " Status against revision: 981\n" "\n" " svn status --show-updates --verbose wc\n" " M 965 938 kfogel wc/bar.c\n" " * 965 922 sussman wc/foo.c\n" " A + 965 687 joe wc/qax.c\n" " 965 687 joe wc/zig.c\n" " Status against revision: 981\n"), { 'u', 'v', 'N', 'q', svn_cl__no_ignore_opt, svn_cl__incremental_opt, svn_cl__xml_opt, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt, svn_cl__ignore_externals_opt} }, { "switch", svn_cl__switch, {"sw"}, N_ ("Update the working copy to a different URL.\n" "usage: 1. switch URL [PATH]\n" " 2. switch --relocate FROM TO [PATH...]\n" "\n" " 1. Update the working copy to mirror a new URL within the repository.\n" " This behaviour is similar to 'svn update', and is the way to\n" " move a working copy to a branch or tag within the same repository.\n" "\n" " 2. Rewrite working copy URL metadata to reflect a syntactic change only.\n" " This is used when repository's root URL changes (such as a scheme\n" " or hostname change) but your working copy still reflects the same\n" " directory within the same repository.\n"), { 'r', 'N', 'q', svn_cl__merge_cmd_opt, svn_cl__relocate_opt, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} }, { "unlock", svn_cl__unlock, {0}, N_ ("Unlock working copy paths or URLs.\n" "usage: unlock TARGET...\n" "\n" " Use --force to break the lock.\n"), { svn_cl__targets_opt, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt, svn_cl__force_opt } }, { "update", svn_cl__update, {"up"}, N_ ("Bring changes from the repository into the working copy.\n" "usage: update [PATH...]\n" "\n" " If no revision given, bring working copy up-to-date with HEAD rev.\n" " Else synchronize working copy to revision given by -r.\n" "\n" " For each updated item a line will start with a character reporting the\n" " action taken. These characters have the following meaning:\n" "\n" " A Added\n" " D Deleted\n" " U Updated\n" " C Conflict\n" " G Merged\n" "\n" " A character in the first column signifies an update to the actual file,\n" " while updates to the file's properties are shown in the second column.\n" " A 'B' in the third column signifies that the lock for the file has\n" " been broken or stolen.\n"), {'r', 'N', 'q', svn_cl__merge_cmd_opt, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt, svn_cl__ignore_externals_opt} }, { NULL, NULL, {0}, NULL, {0} }};/* Version compatibility check */static svn_error_t *check_lib_versions(void){ static const svn_version_checklist_t checklist[] = { { "svn_subr", svn_subr_version }, { "svn_client", svn_client_version }, { "svn_wc", svn_wc_version }, { "svn_ra", svn_ra_version }, { "svn_delta", svn_delta_version }, { "svn_diff", svn_diff_version }, { NULL, NULL } }; SVN_VERSION_DEFINE(my_version); return svn_ver_check_list(&my_version, checklist);}/* A flag to see if we've been cancelled by the client or not. */static volatile sig_atomic_t cancelled = FALSE;/* A signal handler to support cancellation. */static voidsignal_handler(int signum){ apr_signal(signum, SIG_IGN); cancelled = TRUE;}/* Our cancellation callback. */svn_error_t *svn_cl__check_cancel(void *baton){ if (cancelled) return svn_error_create(SVN_ERR_CANCELLED, NULL, _("Caught signal")); else return SVN_NO_ERROR;}/*** Main. ***/intmain(int argc, const char *argv[]){ svn_error_t *err; apr_allocator_t *allocator; apr_pool_t *pool; int opt_id; apr_getopt_t *os; svn_cl__opt_state_t opt_state = { { 0 } }; svn_client_ctx_t *ctx; apr_array_header_t *received_opts; int i; const svn_opt_subcommand_desc2_t *subcommand = NULL; const char *dash_m_arg = NULL, *dash_F_arg = NULL; const char *path_utf8; apr_status_t apr_err; svn_cl__cmd_baton_t command_baton; svn_auth_baton_t *ab; svn_config_t *cfg; svn_boolean_t used_change_arg = FALSE; /* Initialize the app. */ if (svn_cmdline_init("svn", stderr) != EXIT_SUCCESS) return EXIT_FAILURE; /* Create our top-level pool. Use a seperate mutexless allocator, * given this application is single threaded. */ if (apr_allocator_create(&allocator)) return EXIT_FAILURE; apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE); pool = svn_pool_create_ex(NULL, allocator); apr_allocator_owner_set(allocator, pool); received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int)); /* Check library versions */ err = check_lib_versions(); if (err) return svn_cmdline_handle_exit_error(err, pool, "svn: ");#if defined(WIN32) || defined(__CYGWIN__) /* Set the working copy administrative directory name. */ if (getenv("SVN_ASP_DOT_NET_HACK")) { err = svn_wc_set_adm_dir("_svn", pool); if (err) return svn_cmdline_handle_exit_error(err, pool, "svn: "); }#endif /* Initialize the RA library. */ err = svn_ra_initialize(pool); if (err) return svn_cmdline_handle_exit_error(err, pool, "svn: "); /* Begin processing arguments. */ opt_state.start_revision.kind = svn_opt_revision_unspecified; opt_state.end_revision.kind = svn_opt_revision_unspecified; /* No args? Show usage. */ if (argc <= 1) { svn_cl__help(NULL, NULL, pool); svn_pool_destroy(pool); return EXIT_FAILURE; } /* Else, parse options. */ err = svn_cmdline__getopt_init(&os, argc, argv, pool); if (err) return svn_cmdline_handle_exit_error(err, pool, "svn: "); os->interleave = 1; while (1) { const char *opt_arg; const char *utf8_opt_arg; /* Parse the next option. */ apr_err = apr_getopt_long(os, svn_cl__options, &opt_id, &opt_arg); if (APR_STATUS_IS_EOF(apr_err)) break; else if (apr_err) { svn_cl__help(NULL, NULL, pool); svn_pool_destroy(pool); return EXIT_FAILURE; } /* Stash the option code in an array before parsing it. */ APR_ARRAY_PUSH(received_opts, int) = opt_id; switch (opt_id) { case svn_cl__limit_opt: {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -