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

« back to all changes in this revision

Viewing changes to subversion/libsvn_wc/deprecated.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:
127
127
       hi;
128
128
       hi = apr_hash_next(hi))
129
129
    {
130
 
      const char *node_abspath = svn__apr_hash_index_key(hi);
 
130
      const char *node_abspath = apr_hash_this_key(hi);
131
131
      const char *relpath;
132
132
 
133
133
      relpath = svn_dirent_join(path,
137
137
 
138
138
      if (gather_as_old)
139
139
        svn_hash_sets(traversal_info->externals_old, relpath,
140
 
                      svn__apr_hash_index_val(hi));
 
140
                      apr_hash_this_val(hi));
141
141
 
142
142
      if (gather_as_new)
143
143
        svn_hash_sets(traversal_info->externals_new, relpath,
144
 
                      svn__apr_hash_index_val(hi));
 
144
                      apr_hash_this_val(hi));
145
145
 
146
146
      svn_hash_sets(traversal_info->depths, relpath,
147
147
                    svn_hash_gets(ambient_depths, node_abspath));
652
652
  return svn_error_trace(svn_wc_context_destroy(wc_ctx));
653
653
}
654
654
 
 
655
svn_error_t *
 
656
svn_wc_queue_committed3(svn_wc_committed_queue_t *queue,
 
657
                        svn_wc_context_t *wc_ctx,
 
658
                        const char *local_abspath,
 
659
                        svn_boolean_t recurse,
 
660
                        const apr_array_header_t *wcprop_changes,
 
661
                        svn_boolean_t remove_lock,
 
662
                        svn_boolean_t remove_changelist,
 
663
                        const svn_checksum_t *sha1_checksum,
 
664
                        apr_pool_t *scratch_pool)
 
665
{
 
666
  return svn_error_trace(
 
667
            svn_wc_queue_committed4(queue, wc_ctx, local_abspath,
 
668
                                    recurse, TRUE /* is_committed */,
 
669
                                    wcprop_changes, remove_lock,
 
670
                                    remove_changelist, sha1_checksum,
 
671
                                    scratch_pool));
 
672
}
655
673
 
656
674
svn_error_t *
657
675
svn_wc_queue_committed2(svn_wc_committed_queue_t *queue,
668
686
  const char *local_abspath;
669
687
  const svn_checksum_t *sha1_checksum = NULL;
670
688
 
671
 
  SVN_ERR(svn_wc_context_create(&wc_ctx, NULL, scratch_pool, scratch_pool));
 
689
  SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL,
 
690
                                         svn_wc__adm_get_db(adm_access),
 
691
                                         scratch_pool));
672
692
  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
673
693
 
674
694
  if (md5_checksum != NULL)
759
779
  const char *local_abspath;
760
780
  const svn_checksum_t *md5_checksum;
761
781
  const svn_checksum_t *sha1_checksum = NULL;
762
 
  apr_time_t new_date;
763
 
  apr_hash_t *wcprop_changes_hash;
 
782
  svn_wc_context_t *wc_ctx;
 
783
  svn_wc_committed_queue_t *queue;
764
784
 
765
785
  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
766
 
 
767
 
  if (rev_date)
768
 
    SVN_ERR(svn_time_from_cstring(&new_date, rev_date, pool));
769
 
  else
770
 
    new_date = 0;
 
786
  SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL, db, pool));
771
787
 
772
788
  if (digest)
773
789
    md5_checksum = svn_checksum__from_digest_md5(digest, pool);
790
806
        SVN_ERR(err);
791
807
    }
792
808
 
793
 
  wcprop_changes_hash = svn_wc__prop_array_to_hash(wcprop_changes, pool);
794
 
  SVN_ERR(svn_wc__process_committed_internal(db, local_abspath, recurse, TRUE,
795
 
                                             new_revnum, new_date, rev_author,
796
 
                                             wcprop_changes_hash,
797
 
                                             !remove_lock, !remove_changelist,
798
 
                                             sha1_checksum, NULL, pool));
799
 
 
800
 
  /* Run the log file(s) we just created. */
801
 
  return svn_error_trace(svn_wc__wq_run(db, local_abspath, NULL, NULL, pool));
 
809
  queue = svn_wc_committed_queue_create(pool);
 
810
  SVN_ERR(svn_wc_queue_committed3(queue, wc_ctx, local_abspath, recurse,
 
811
                                  wcprop_changes, remove_lock,
 
812
                                  remove_changelist,
 
813
                                  sha1_checksum /* or NULL if not modified
 
814
                                                           or directory */,
 
815
                                  pool));
 
816
 
 
817
  SVN_ERR(svn_wc_process_committed_queue2(queue, wc_ctx,
 
818
                                          new_revnum, rev_date, rev_author,
 
819
                                          NULL, NULL /* cancel */,
 
820
                                          pool));
 
821
 
 
822
  return svn_error_trace(svn_wc_context_destroy(wc_ctx));
802
823
}
803
824
 
804
825
 
925
946
}
926
947
 
927
948
svn_error_t *
 
949
svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
 
950
                     const char *local_abspath,
 
951
                     const apr_hash_t *props,
 
952
                     svn_wc_notify_func2_t notify_func,
 
953
                     void *notify_baton,
 
954
                     apr_pool_t *scratch_pool)
 
955
{
 
956
  SVN_ERR(svn_wc_add_from_disk3(wc_ctx, local_abspath, props, FALSE,
 
957
                                 notify_func, notify_baton, scratch_pool));
 
958
  return SVN_NO_ERROR;
 
959
}
 
960
 
 
961
svn_error_t *
928
962
svn_wc_add_from_disk(svn_wc_context_t *wc_ctx,
929
963
                     const char *local_abspath,
930
964
                     svn_wc_notify_func2_t notify_func,
1025
1059
                     compat_call_notify_func, &nb, pool);
1026
1060
}
1027
1061
 
 
1062
/*** From revert.c ***/
 
1063
svn_error_t *
 
1064
svn_wc_revert4(svn_wc_context_t *wc_ctx,
 
1065
               const char *local_abspath,
 
1066
               svn_depth_t depth,
 
1067
               svn_boolean_t use_commit_times,
 
1068
               const apr_array_header_t *changelist_filter,
 
1069
               svn_cancel_func_t cancel_func,
 
1070
               void *cancel_baton,
 
1071
               svn_wc_notify_func2_t notify_func,
 
1072
               void *notify_baton,
 
1073
               apr_pool_t *scratch_pool)
 
1074
{
 
1075
  return svn_error_trace(svn_wc_revert5(wc_ctx, local_abspath,
 
1076
                                        depth,
 
1077
                                        use_commit_times,
 
1078
                                        changelist_filter,
 
1079
                                        FALSE /* clear_changelists */,
 
1080
                                        FALSE /* metadata_only */,
 
1081
                                        cancel_func, cancel_baton,
 
1082
                                        notify_func, notify_baton,
 
1083
                                        scratch_pool));
 
1084
}
 
1085
 
1028
1086
svn_error_t *
1029
1087
svn_wc_revert3(const char *path,
1030
1088
               svn_wc_adm_access_t *parent_access,
1966
2024
                        apr_pool_t *result_pool,
1967
2025
                        apr_pool_t *scratch_pool)
1968
2026
{
 
2027
  const svn_diff_tree_processor_t *diff_processor;
 
2028
 
 
2029
  /* --git implies --show-copies-as-adds */
 
2030
  if (use_git_diff_format)
 
2031
    show_copies_as_adds = TRUE;
 
2032
 
 
2033
  /* --show-copies-as-adds implies --notice-ancestry */
 
2034
  if (show_copies_as_adds)
 
2035
    ignore_ancestry = FALSE;
 
2036
 
 
2037
  SVN_ERR(svn_wc__wrap_diff_callbacks(&diff_processor,
 
2038
                                      callbacks, callback_baton, TRUE,
 
2039
                                      result_pool, scratch_pool));
 
2040
 
 
2041
  if (reverse_order)
 
2042
    diff_processor = svn_diff__tree_processor_reverse_create(
 
2043
                              diff_processor, NULL, result_pool);
 
2044
 
 
2045
  if (! show_copies_as_adds)
 
2046
    diff_processor = svn_diff__tree_processor_copy_as_changed_create(
 
2047
                              diff_processor, result_pool);
 
2048
 
1969
2049
  return svn_error_trace(
1970
2050
    svn_wc__get_diff_editor(editor, edit_baton,
1971
2051
                            wc_ctx,
1972
2052
                            anchor_abspath, target,
1973
2053
                            depth,
1974
 
                            ignore_ancestry, show_copies_as_adds,
1975
2054
                            use_git_diff_format, use_text_base,
1976
2055
                            reverse_order, server_performs_filtering,
1977
2056
                            changelist_filter,
1978
 
                            callbacks, callback_baton,
 
2057
                            diff_processor,
1979
2058
                            cancel_func, cancel_baton,
1980
2059
                            result_pool, scratch_pool));
1981
2060
}
2633
2712
}
2634
2713
 
2635
2714
 
 
2715
svn_error_t *
 
2716
svn_wc__status2_from_3(svn_wc_status2_t **status,
 
2717
                       const svn_wc_status3_t *old_status,
 
2718
                       svn_wc_context_t *wc_ctx,
 
2719
                       const char *local_abspath,
 
2720
                       apr_pool_t *result_pool,
 
2721
                       apr_pool_t *scratch_pool)
 
2722
{
 
2723
  const svn_wc_entry_t *entry = NULL;
 
2724
 
 
2725
  if (old_status == NULL)
 
2726
    {
 
2727
      *status = NULL;
 
2728
      return SVN_NO_ERROR;
 
2729
    }
 
2730
 
 
2731
  *status = apr_pcalloc(result_pool, sizeof(**status));
 
2732
 
 
2733
  if (old_status->versioned)
 
2734
    {
 
2735
      svn_error_t *err;
 
2736
      err= svn_wc__get_entry(&entry, wc_ctx->db, local_abspath, FALSE,
 
2737
                             svn_node_unknown, result_pool, scratch_pool);
 
2738
 
 
2739
      if (err && err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND)
 
2740
        svn_error_clear(err);
 
2741
      else
 
2742
        SVN_ERR(err);
 
2743
    }
 
2744
 
 
2745
  (*status)->entry = entry;
 
2746
  (*status)->copied = old_status->copied;
 
2747
  (*status)->repos_lock = svn_lock_dup(old_status->repos_lock, result_pool);
 
2748
 
 
2749
  if (old_status->repos_relpath)
 
2750
    (*status)->url = svn_path_url_add_component2(old_status->repos_root_url,
 
2751
                                                 old_status->repos_relpath,
 
2752
                                                 result_pool);
 
2753
  (*status)->ood_last_cmt_rev = old_status->ood_changed_rev;
 
2754
  (*status)->ood_last_cmt_date = old_status->ood_changed_date;
 
2755
  (*status)->ood_kind = old_status->ood_kind;
 
2756
  (*status)->ood_last_cmt_author = old_status->ood_changed_author;
 
2757
 
 
2758
  if (old_status->conflicted)
 
2759
    {
 
2760
      const svn_wc_conflict_description2_t *tree_conflict2;
 
2761
      SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict2, wc_ctx, local_abspath,
 
2762
                                        scratch_pool, scratch_pool));
 
2763
      (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict2, result_pool);
 
2764
    }
 
2765
 
 
2766
  (*status)->switched = old_status->switched;
 
2767
 
 
2768
  (*status)->text_status = old_status->node_status;
 
2769
  (*status)->prop_status = old_status->prop_status;
 
2770
 
 
2771
  (*status)->repos_text_status = old_status->repos_node_status;
 
2772
  (*status)->repos_prop_status = old_status->repos_prop_status;
 
2773
 
 
2774
  /* Some values might be inherited from properties */
 
2775
  if (old_status->node_status == svn_wc_status_modified
 
2776
      || old_status->node_status == svn_wc_status_conflicted)
 
2777
    (*status)->text_status = old_status->text_status;
 
2778
 
 
2779
  /* (Currently a no-op, but just make sure it is ok) */
 
2780
  if (old_status->repos_node_status == svn_wc_status_modified
 
2781
      || old_status->repos_node_status == svn_wc_status_conflicted)
 
2782
    (*status)->repos_text_status = old_status->repos_text_status;
 
2783
 
 
2784
  if (old_status->node_status == svn_wc_status_added)
 
2785
    (*status)->prop_status = svn_wc_status_none; /* No separate info */
 
2786
 
 
2787
  /* Find pristine_text_status value */
 
2788
  switch (old_status->text_status)
 
2789
    {
 
2790
      case svn_wc_status_none:
 
2791
      case svn_wc_status_normal:
 
2792
      case svn_wc_status_modified:
 
2793
        (*status)->pristine_text_status = old_status->text_status;
 
2794
        break;
 
2795
      case svn_wc_status_conflicted:
 
2796
      default:
 
2797
        /* ### Fetch compare data, or fall back to the documented
 
2798
               not retrieved behavior? */
 
2799
        (*status)->pristine_text_status = svn_wc_status_none;
 
2800
        break;
 
2801
    }
 
2802
 
 
2803
  /* Find pristine_prop_status value */
 
2804
  switch (old_status->prop_status)
 
2805
    {
 
2806
      case svn_wc_status_none:
 
2807
      case svn_wc_status_normal:
 
2808
      case svn_wc_status_modified:
 
2809
        if (old_status->node_status != svn_wc_status_added
 
2810
            && old_status->node_status != svn_wc_status_deleted
 
2811
            && old_status->node_status != svn_wc_status_replaced)
 
2812
          {
 
2813
            (*status)->pristine_prop_status = old_status->prop_status;
 
2814
          }
 
2815
        else
 
2816
          (*status)->pristine_prop_status = svn_wc_status_none;
 
2817
        break;
 
2818
      case svn_wc_status_conflicted:
 
2819
      default:
 
2820
        /* ### Fetch compare data, or fall back to the documented
 
2821
               not retrieved behavior? */
 
2822
        (*status)->pristine_prop_status = svn_wc_status_none;
 
2823
        break;
 
2824
    }
 
2825
 
 
2826
  if (old_status->versioned
 
2827
      && old_status->conflicted
 
2828
      && old_status->node_status != svn_wc_status_obstructed
 
2829
      && (old_status->kind == svn_node_file
 
2830
          || old_status->node_status != svn_wc_status_missing))
 
2831
    {
 
2832
      svn_boolean_t text_conflict_p, prop_conflict_p;
 
2833
 
 
2834
      /* The entry says there was a conflict, but the user might have
 
2835
         marked it as resolved by deleting the artifact files, so check
 
2836
         for that. */
 
2837
      SVN_ERR(svn_wc__internal_conflicted_p(&text_conflict_p,
 
2838
                                            &prop_conflict_p,
 
2839
                                            NULL,
 
2840
                                            wc_ctx->db, local_abspath,
 
2841
                                            scratch_pool));
 
2842
 
 
2843
      if (text_conflict_p)
 
2844
        (*status)->text_status = svn_wc_status_conflicted;
 
2845
 
 
2846
      if (prop_conflict_p)
 
2847
        (*status)->prop_status = svn_wc_status_conflicted;
 
2848
    }
 
2849
 
 
2850
  return SVN_NO_ERROR;
 
2851
}
 
2852
 
 
2853
 
 
2854
 
2636
2855
/*** From status.c ***/
2637
2856
 
2638
2857
struct status4_wrapper_baton
2698
2917
                              wc_ctx,
2699
2918
                              anchor_abspath,
2700
2919
                              target_basename,
2701
 
                              depth,
2702
 
                              get_all, no_ignore,
2703
 
                              depth_as_sticky,
 
2920
                              depth, get_all,
 
2921
                              TRUE, /* check_working_copy */
 
2922
                              no_ignore, depth_as_sticky,
2704
2923
                              server_performs_filtering,
2705
2924
                              ignore_patterns,
2706
2925
                              status_func, status_baton,
4044
4263
}
4045
4264
 
4046
4265
 
4047
 
/*** From log.c ***/
 
4266
/*** From log.c / cleanup.c ***/
 
4267
 
 
4268
svn_error_t *
 
4269
svn_wc_cleanup3(svn_wc_context_t *wc_ctx,
 
4270
                const char *local_abspath,
 
4271
                svn_cancel_func_t cancel_func,
 
4272
                void *cancel_baton,
 
4273
                apr_pool_t *scratch_pool)
 
4274
{
 
4275
  return svn_error_trace(
 
4276
            svn_wc_cleanup4(wc_ctx,
 
4277
                            local_abspath,
 
4278
                            TRUE /* break_locks */,
 
4279
                            TRUE /* fix_recorded_timestamps */,
 
4280
                            TRUE /* clear_dav_cache */,
 
4281
                            TRUE /* clean_pristines */,
 
4282
                            cancel_func, cancel_baton,
 
4283
                            NULL, NULL /* notify */,
 
4284
                            scratch_pool));
 
4285
}
4048
4286
 
4049
4287
svn_error_t *
4050
4288
svn_wc_cleanup2(const char *path,
4570
4808
                            TRUE /* show_deleted */,
4571
4809
                            show_hidden,
4572
4810
                            scratch_pool));
4573
 
 
4574
 
  /*if (db_kind == svn_node_dir)
4575
 
    *kind = svn_node_dir;
4576
 
  else if (db_kind == svn_node_file || db_kind == svn_node_symlink)
4577
 
    *kind = svn_node_file;
4578
 
  else
4579
 
    *kind = svn_node_none;*/
4580
 
 
4581
 
  return SVN_NO_ERROR;
 
4811
}
 
4812
 
 
4813
svn_wc_conflict_description2_t *
 
4814
svn_wc__conflict_description2_dup(const svn_wc_conflict_description2_t *conflict,
 
4815
                                  apr_pool_t *pool)
 
4816
{
 
4817
  return svn_wc_conflict_description2_dup(conflict, pool);
4582
4818
}