~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/libsvn_diff/util.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include "svn_diff.h"
35
35
#include "svn_types.h"
36
36
#include "svn_ctype.h"
37
 
#include "svn_sorts.h"
38
37
#include "svn_utf.h"
39
38
#include "svn_version.h"
40
39
 
41
40
#include "private/svn_diff_private.h"
 
41
#include "private/svn_sorts_private.h"
42
42
#include "diff.h"
43
43
 
44
44
#include "svn_private_config.h"
77
77
}
78
78
 
79
79
svn_error_t *
80
 
svn_diff_output(svn_diff_t *diff,
81
 
                void *output_baton,
82
 
                const svn_diff_output_fns_t *vtable)
 
80
svn_diff_output2(svn_diff_t *diff,
 
81
                 void *output_baton,
 
82
                 const svn_diff_output_fns_t *vtable,
 
83
                 svn_cancel_func_t cancel_func,
 
84
                 void *cancel_baton)
83
85
{
84
86
  svn_error_t *(*output_fn)(void *,
85
87
                            apr_off_t, apr_off_t,
88
90
 
89
91
  while (diff != NULL)
90
92
    {
 
93
      if (cancel_func)
 
94
        SVN_ERR(cancel_func(cancel_baton));
 
95
 
91
96
      switch (diff->type)
92
97
        {
93
98
        case svn_diff__type_common:
449
454
                              new_mergeinfo_hash,
450
455
                              TRUE, pool, pool));
451
456
 
 
457
  /* Print a hint for 'svn patch' or smilar tools, indicating the
 
458
   * number of reverse-merges and forward-merges. */
 
459
  SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
 
460
                                      "## -0,%u +0,%u ##%s",
 
461
                                      apr_hash_count(deleted),
 
462
                                      apr_hash_count(added),
 
463
                                      APR_EOL_STR));
 
464
 
452
465
  for (hi = apr_hash_first(pool, deleted);
453
466
       hi; hi = apr_hash_next(hi))
454
467
    {
455
 
      const char *from_path = svn__apr_hash_index_key(hi);
456
 
      svn_rangelist_t *merge_revarray = svn__apr_hash_index_val(hi);
 
468
      const char *from_path = apr_hash_this_key(hi);
 
469
      svn_rangelist_t *merge_revarray = apr_hash_this_val(hi);
457
470
      svn_string_t *merge_revstr;
458
471
 
459
472
      svn_pool_clear(iterpool);
469
482
  for (hi = apr_hash_first(pool, added);
470
483
       hi; hi = apr_hash_next(hi))
471
484
    {
472
 
      const char *from_path = svn__apr_hash_index_key(hi);
473
 
      svn_rangelist_t *merge_revarray = svn__apr_hash_index_val(hi);
 
485
      const char *from_path = apr_hash_this_key(hi);
 
486
      svn_rangelist_t *merge_revarray = apr_hash_this_val(hi);
474
487
      svn_string_t *merge_revstr;
475
488
 
476
489
      svn_pool_clear(iterpool);
487
500
  return SVN_NO_ERROR;
488
501
}
489
502
 
490
 
/* qsort callback handling svn_prop_t by name */
 
503
/* svn_sort__array callback handling svn_prop_t by name */
491
504
static int
492
505
propchange_sort(const void *k1, const void *k2)
493
506
{
503
516
                             const apr_array_header_t *propchanges,
504
517
                             apr_hash_t *original_props,
505
518
                             svn_boolean_t pretty_print_mergeinfo,
 
519
                             int context_size,
 
520
                             svn_cancel_func_t cancel_func,
 
521
                             void *cancel_baton,
506
522
                             apr_pool_t *scratch_pool)
507
523
{
508
524
  apr_pool_t *pool = scratch_pool;
510
526
  apr_array_header_t *changes = apr_array_copy(scratch_pool, propchanges);
511
527
  int i;
512
528
 
513
 
  qsort(changes->elts, changes->nelts, changes->elt_size, propchange_sort);
 
529
  svn_sort__array(changes, propchange_sort);
514
530
 
515
531
  for (i = 0; i < changes->nelts; i++)
516
532
    {
586
602
         * from the diff header. But there usually are no files which
587
603
         * UNIX patch could apply the property diff to, so we use "##"
588
604
         * instead of "@@" as the default hunk delimiter for property diffs.
589
 
         * We also supress the diff header. */
590
 
        SVN_ERR(svn_diff_mem_string_output_unified2(
 
605
         * We also suppress the diff header. */
 
606
        SVN_ERR(svn_diff_mem_string_output_unified3(
591
607
                  outstream, diff, FALSE /* no header */, "##", NULL, NULL,
592
 
                  encoding, orig, val, iterpool));
 
608
                  encoding, orig, val, context_size,
 
609
                  cancel_func, cancel_baton, iterpool));
593
610
      }
594
611
    }
595
612
  svn_pool_destroy(iterpool);