65
65
svn_cl__accept_working,
67
67
/* Resolve the conflicted hunks by choosing the corresponding text
68
from the pre-conflict working copy file.
70
Note: this is a placeholder, not actually implemented in 1.5. */
68
from the pre-conflict working copy file. */
71
69
svn_cl__accept_mine_conflict,
73
71
/* Resolve the conflicted hunks by choosing the corresponding text
74
from the post-conflict base copy file.
76
Note: this is a placeholder, not actually implemented in 1.5. */
72
from the post-conflict base copy file. */
77
73
svn_cl__accept_theirs_conflict,
79
75
/* Resolve the conflict by taking the entire pre-conflict working
183
178
svn_boolean_t xml; /* output in xml, e.g., "svn log --xml" */
184
179
svn_boolean_t no_ignore; /* disregard default ignores & svn:ignore's */
185
180
svn_boolean_t no_auth_cache; /* do not cache authentication information */
186
svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
183
const char *diff_cmd; /* the external diff command to use */
184
svn_boolean_t internal_diff; /* override diff_cmd in config file */
185
svn_boolean_t no_diff_added; /* do not show diffs for deleted files */
186
svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
187
187
svn_boolean_t show_copies_as_adds; /* do not diff copies with their source */
188
svn_boolean_t notice_ancestry; /* notice ancestry for diff-y operations */
188
svn_boolean_t notice_ancestry; /* notice ancestry for diff-y operations */
189
svn_boolean_t summarize; /* create a summary of a diff */
190
svn_boolean_t use_git_diff_format; /* Use git's extended diff format */
191
svn_boolean_t ignore_properties; /* ignore properties */
192
svn_boolean_t properties_only; /* Show properties only */
193
svn_boolean_t patch_compatible; /* Output compatible with GNU patch */
189
195
svn_boolean_t ignore_ancestry; /* ignore ancestry for merge-y operations */
190
196
svn_boolean_t ignore_externals;/* ignore externals definitions */
191
197
svn_boolean_t stop_on_copy; /* don't cross copies during processing */
192
198
svn_boolean_t dry_run; /* try operation but make no changes */
193
199
svn_boolean_t revprop; /* operate on a revision property */
194
const char *diff_cmd; /* the external diff command to use */
195
200
const char *merge_cmd; /* the external merge command to use */
196
201
const char *editor_cmd; /* the external editor command to use */
197
202
svn_boolean_t record_only; /* whether to record mergeinfo */
215
219
apr_hash_t *revprop_table; /* table of revision properties to get/set */
216
220
svn_boolean_t parents; /* create intermediate directories */
217
221
svn_boolean_t use_merge_history; /* use/display extra merge information */
218
svn_cl__accept_t accept_which; /* how to handle conflicts */
219
svn_cl__show_revs_t show_revs; /* mergeinfo flavor */
220
svn_depth_t set_depth; /* new sticky ambient depth value */
221
svn_boolean_t reintegrate; /* use "reintegrate" merge-source heuristic */
222
svn_cl__accept_t accept_which; /* how to handle conflicts */
223
svn_cl__show_revs_t show_revs; /* mergeinfo flavor */
224
svn_depth_t set_depth; /* new sticky ambient depth value */
225
svn_boolean_t reintegrate; /* use "reintegrate" merge-source heuristic */
222
226
svn_boolean_t trust_server_cert; /* trust server SSL certs that would
223
227
otherwise be rejected as "untrusted" */
224
228
int strip; /* number of leading path components to strip */
225
svn_boolean_t ignore_keywords; /* do not expand keywords */
226
svn_boolean_t reverse_diff; /* reverse a diff (e.g. when patching) */
229
svn_boolean_t ignore_keywords; /* do not expand keywords */
230
svn_boolean_t reverse_diff; /* reverse a diff (e.g. when patching) */
227
231
svn_boolean_t ignore_whitespace; /* don't account for whitespace when
229
svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
230
svn_boolean_t internal_diff; /* override diff_cmd in config file */
231
svn_boolean_t use_git_diff_format; /* Use git's extended diff format */
232
svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
233
svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
234
svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
235
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
236
svn_boolean_t show_inherited_props; /* get inherited properties */
237
apr_array_header_t* search_patterns; /* pattern arguments for --search */
233
238
} svn_cl__opt_state_t;
323
328
/* Various conflict-resolution callbacks. */
325
typedef struct svn_cl__conflict_baton_t {
326
svn_cl__accept_t accept_which;
328
const char *editor_cmd;
329
svn_boolean_t external_failed;
330
svn_cmdline_prompt_baton_t *pb;
331
} svn_cl__conflict_baton_t;
333
/* Create and return a conflict baton, allocated from POOL, with the values
334
ACCEPT_WHICH, CONFIG, EDITOR_CMD and PB placed in the same-named fields
335
of the baton, and its 'external_failed' field initialised to FALSE. */
336
svn_cl__conflict_baton_t *
337
svn_cl__conflict_baton_make(svn_cl__accept_t accept_which,
339
const char *editor_cmd,
340
svn_cmdline_prompt_baton_t *pb,
343
/* A conflict-resolution callback which prompts the user to choose
344
one of the 3 fulltexts, edit the merged file on the spot, or just
345
skip the conflict (to be resolved later).
346
Implements @c svn_wc_conflict_resolver_func_t. */
348
svn_cl__conflict_handler(svn_wc_conflict_result_t **result,
349
const svn_wc_conflict_description_t *desc,
330
/* Opaque baton type for svn_cl__conflict_func_interactive(). */
331
typedef struct svn_cl__interactive_conflict_baton_t
332
svn_cl__interactive_conflict_baton_t;
334
/* Conflict stats for operations such as update and merge. */
335
typedef struct svn_cl__conflict_stats_t svn_cl__conflict_stats_t;
337
/* Return a new, initialized, conflict stats structure, allocated in
339
svn_cl__conflict_stats_t *
340
svn_cl__conflict_stats_create(apr_pool_t *pool);
342
/* Update CONFLICT_STATS to reflect that a conflict on PATH_LOCAL of kind
343
* CONFLICT_KIND is resolved. (There is no support for updating the
344
* 'skipped paths' stats, since skips cannot be 'resolved'.) */
346
svn_cl__conflict_stats_resolved(svn_cl__conflict_stats_t *conflict_stats,
347
const char *path_local,
348
svn_wc_conflict_kind_t conflict_kind);
351
/* Create and return an baton for use with svn_cl__conflict_func_interactive
352
* in *B, allocated from RESULT_POOL, and initialised with the values
353
* ACCEPT_WHICH, CONFIG, EDITOR_CMD, CANCEL_FUNC and CANCEL_BATON. */
355
svn_cl__get_conflict_func_interactive_baton(
356
svn_cl__interactive_conflict_baton_t **b,
357
svn_cl__accept_t accept_which,
359
const char *editor_cmd,
360
svn_cl__conflict_stats_t *conflict_stats,
361
svn_cancel_func_t cancel_func,
363
apr_pool_t *result_pool);
365
/* A callback capable of doing interactive conflict resolution.
367
The BATON must come from svn_cl__get_conflict_func_interactive_baton().
368
Resolves based on the --accept option if one was given to that function,
369
otherwise prompts the user to choose one of the three fulltexts, edit
370
the merged file on the spot, or just skip the conflict (to be resolved
371
later), among other options.
373
Implements svn_wc_conflict_resolver_func2_t.
376
svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
377
const svn_wc_conflict_description2_t *desc,
379
apr_pool_t *result_pool,
380
apr_pool_t *scratch_pool);
355
383
/*** Command-line output functions -- printing to the user. ***/
393
424
Increment *TEXT_CONFLICTS, *PROP_CONFLICTS, or *TREE_CONFLICTS if
394
425
a conflict was encountered.
427
Use TARGET_ABSPATH and TARGET_PATH to shorten PATH into something
428
relative to the target as necessary.
397
svn_cl__print_status(const char *path,
431
svn_cl__print_status(const char *target_abspath,
432
const char *target_path,
398
434
const svn_client_status_t *status,
435
svn_boolean_t suppress_externals_placeholders,
399
436
svn_boolean_t detailed,
400
437
svn_boolean_t show_last_committed,
401
438
svn_boolean_t skip_unrecognized,
410
447
/* Print STATUS for PATH in XML to stdout. Use POOL for temporary
450
Use TARGET_ABSPATH and TARGET_PATH to shorten PATH into something
451
relative to the target as necessary.
413
svn_cl__print_status_xml(const char *path,
454
svn_cl__print_status_xml(const char *target_abspath,
455
const char *target_path,
414
457
const svn_client_status_t *status,
415
458
svn_client_ctx_t *ctx,
416
459
apr_pool_t *pool);
419
/* Print to stdout a hash that maps property names (char *) to property
420
values (svn_string_t *). The names are assumed to be in UTF-8 format;
421
the values are either in UTF-8 (the special Subversion props) or
424
If OUT is not NULL, then write to it rather than stdout.
426
If NAMES_ONLY is true, print just names, else print names and
429
svn_cl__print_prop_hash(svn_stream_t *out,
430
apr_hash_t *prop_hash,
431
svn_boolean_t names_only,
434
/* Same as svn_cl__print_prop_hash(), only output xml to *OUTSTR. If *OUTSTR is
435
NULL, allocate it first from POOL, otherwise append to it. */
437
svn_cl__print_xml_prop_hash(svn_stringbuf_t **outstr,
438
apr_hash_t *prop_hash,
439
svn_boolean_t names_only,
442
461
/* Output a commit xml element to *OUTSTR. If *OUTSTR is NULL, allocate it
443
462
first from POOL, otherwise append to it. If AUTHOR or DATE is
444
463
NULL, it will be omitted. */
470
489
svn_client_ctx_t *ctx,
471
490
apr_pool_t *pool);
473
/* Search for a text editor command in standard environment variables,
474
and invoke it to edit CONTENTS (using a temporary file created in
475
directory BASE_DIR). Return the new contents in *EDITED_CONTENTS,
476
or set *EDITED_CONTENTS to NULL if no edit was performed.
478
If EDITOR_CMD is not NULL, it is the name of the external editor
479
command to use, overriding anything else that might determine the
482
If TMPFILE_LEFT is NULL, the temporary file will be destroyed.
483
Else, the file will be left on disk, and its path returned in
486
CONFIG is a hash of svn_config_t * items keyed on a configuration
487
category (SVN_CONFIG_CATEGORY_CONFIG et al), and may be NULL.
489
If AS_TEXT is TRUE, recode CONTENTS and convert to native eol-style before
490
editing and back again afterwards. In this case, ENCODING determines the
491
encoding used during editing. If non-NULL, use the named encoding, else
492
use the system encoding. If AS_TEXT is FALSE, don't do any translation.
493
In that case, ENCODING is ignored.
495
Use POOL for all allocations. Use PREFIX as the prefix for the
496
temporary file used by the editor.
498
If return error, *EDITED_CONTENTS is not touched. */
500
svn_cl__edit_string_externally(svn_string_t **edited_contents,
501
const char **tmpfile_left,
502
const char *editor_cmd,
503
const char *base_dir,
504
const svn_string_t *contents,
507
svn_boolean_t as_text,
508
const char *encoding,
512
/* Search for a text editor command in standard environment variables,
513
and invoke it to edit PATH. Use POOL for all allocations.
515
If EDITOR_CMD is not NULL, it is the name of the external editor
516
command to use, overriding anything else that might determine the
519
CONFIG is a hash of svn_config_t * items keyed on a configuration
520
category (SVN_CONFIG_CATEGORY_CONFIG et al), and may be NULL. */
522
svn_cl__edit_file_externally(const char *path,
523
const char *editor_cmd,
527
492
/* Search for a merge tool command in environment variables,
528
493
and use it to perform the merge of the four given files.
529
494
WC_PATH is the path of the file that is in conflict, relative
546
511
svn_boolean_t *remains_in_conflict,
547
512
apr_pool_t *pool);
514
/* Like svn_cl__merge_file_externally, but using a built-in merge tool
515
* with help from an external editor specified by EDITOR_CMD. */
517
svn_cl__merge_file(const char *base_path,
518
const char *their_path,
520
const char *merged_path,
522
const char *path_prefix,
523
const char *editor_cmd,
525
svn_boolean_t *remains_in_conflict,
526
apr_pool_t *scratch_pool);
551
529
/*** Notification functions to display results on the terminal. */
553
531
/* Set *NOTIFY_FUNC_P and *NOTIFY_BATON_P to a notifier/baton for all
554
532
* operations, allocated in POOL.
556
* If don't want a summary line at the end of notifications, set
557
* SUPPRESS_FINAL_LINE.
560
535
svn_cl__get_notifier(svn_wc_notify_func2_t *notify_func_p,
561
536
void **notify_baton_p,
562
svn_boolean_t suppress_final_line,
537
svn_cl__conflict_stats_t *conflict_stats,
563
538
apr_pool_t *pool);
565
540
/* Make the notifier for use with BATON print the appropriate summary
595
570
const svn_wc_notify_t *n,
596
571
apr_pool_t *pool);
598
/* Print conflict stats accumulated in NOTIFY_BATON.
573
/* Print the conflict stats accumulated in BATON, which is the
574
* notifier baton from svn_cl__get_notifier().
599
575
* Return any error encountered during printing.
600
* Do all allocations in POOL.*/
602
svn_cl__print_conflict_stats(void *notify_baton, apr_pool_t *pool);
605
/*** Log message callback stuffs. ***/
578
svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool);
581
/*** Log message callback stuffs. ***/
607
583
/* Allocate in POOL a baton for use with svn_cl__get_log_message().
709
685
apr_pool_t *pool);
688
/* What use is a property name intended for.
689
Used by svn_cl__check_svn_prop_name to customize error messages. */
690
typedef enum svn_cl__prop_use_e
692
svn_cl__prop_use_set, /* setting the property */
693
svn_cl__prop_use_edit, /* editing the property */
694
svn_cl__prop_use_use /* using the property name */
698
/* If PROPNAME looks like but is not identical to one of the svn:
699
* poperties, raise an error and suggest a better spelling. Names that
700
* raise errors look like this:
702
* - start with svn: but do not exactly match a known property; or,
703
* - start with a 3-letter prefix that differs in only one letter
704
* from "svn:", and the rest exactly matches a known propery.
706
* If REVPROP is TRUE, only check revision property names; otherwise
707
* only check node property names.
709
* Use SCRATCH_POOL for temporary allocations.
712
svn_cl__check_svn_prop_name(const char *propname,
713
svn_boolean_t revprop,
714
svn_cl__prop_use_t prop_use,
715
apr_pool_t *scratch_pool);
712
717
/* If PROPNAME is one of the svn: properties with a boolean value, and
713
718
* PROPVAL looks like an attempt to turn the property off (i.e., it's
714
719
* "off", "no", "false", or ""), then print a warning to the user that
745
750
svn_boolean_t keep_dest_origpath_on_truepath_collision,
746
751
apr_pool_t *pool);
748
/* Return a string allocated in POOL that is a copy of STR but with each
749
* line prefixed with INDENT. A line is all characters up to the first
750
* CR-LF, LF-CR, CR or LF, or the end of STR if sooner. */
752
svn_cl__indent_string(const char *str,
757
753
/* Return a string showing NODE's kind, URL and revision, to the extent that
758
754
* that information is available in NODE. If NODE itself is NULL, this prints
759
755
* just a 'none' node kind.
766
762
const char *wc_repos_root_URL,
767
763
apr_pool_t *pool);
769
/* Return, in @a *true_targets_p, a copy of @a targets with peg revision
770
* specifiers snipped off the end of each element.
772
* ### JAF TODO: This function is not good because it does not allow the
773
* ### caller to detect if an invalid peg revision was specified.
775
* ### Callers should never have a need to silently *discard* all peg
776
* ### revisions, even if they are doing this *after* saving any peg
777
* ### revisions that might be of interest on certain arguments: I don't
778
* ### think it can ever be correct to silently ignore a peg revision that
779
* ### is specified, whether it makes semantic sense or not.
781
* ### Instead, callers should parse all the arguments and silently
782
* ### ignore an *empty* peg revision part (just an "@", which can be
783
* ### used to escape an earlier "@" in the argument) on any argument,
784
* ### even an argument on which a peg revision does not make sense,
785
* ### but should not silently ignore a non-empty peg when it does not
788
* ### Something like:
789
* ### For each (URL-like?) argument that doesn't accept a peg rev:
790
* ### Parse into peg-rev and true-path parts;
791
* ### If (peg rev != unspecified)
792
* ### Error("This arg doesn't accept a peg rev.").
793
* ### Use the true-path part.
765
/* Return, in @a *true_targets_p, a shallow copy of @a targets with any
766
* empty peg revision specifier snipped off the end of each element. If any
767
* target has a non-empty peg revision specifier, throw an error. The user
768
* may have specified a peg revision where it doesn't make sense to do so,
769
* or may have forgotten to escape an '@' character in a filename.
795
771
* This function is useful for subcommands for which peg revisions
796
* do not make any sense. Such subcommands still need to allow peg
797
* revisions to be specified on the command line so that users of
772
* do not make any sense. Such subcommands still need to allow an empty
773
* peg revision to be specified on the command line so that users of
798
774
* the command line client can consistently escape '@' characters
799
775
* in filenames by appending an '@' character, regardless of the
800
776
* subcommand being used.
802
* If a peg revision is present but cannot be parsed, an error is thrown.
803
* The user has likely forgotten to escape an '@' character in a filename.
805
778
* It is safe to pass the address of @a targets as @a true_targets_p.
807
780
* Do all allocations in @a pool. */
833
806
const char *path,
834
807
apr_pool_t *pool);
809
/* If the user is setting a mime-type to mark one of the TARGETS as binary,
810
* as determined by property name PROPNAME and value PROPVAL, then check
811
* whether Subversion's own binary-file detection recognizes the target as
812
* a binary file. If Subversion doesn't consider the target to be a binary
813
* file, assume the user is making an error and print a warning to inform
814
* the user that some operations might fail on the file in the future. */
816
svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets,
817
const char *propname,
818
const svn_string_t *propval,
819
apr_pool_t *scratch_pool);
821
/* A wrapper around the deprecated svn_client_merge_reintegrate. */
823
svn_cl__deprecated_merge_reintegrate(const char *source_path_or_url,
824
const svn_opt_revision_t *src_peg_revision,
825
const char *target_wcpath,
826
svn_boolean_t dry_run,
827
const apr_array_header_t *merge_options,
828
svn_client_ctx_t *ctx,
836
831
#ifdef __cplusplus
838
833
#endif /* __cplusplus */