~ubuntu-branches/ubuntu/karmic/kdesvn/karmic

« back to all changes in this revision

Viewing changes to src/svnqt/client_merge.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-08-01 15:25:42 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20090801152542-r92s832ommna5bvu
Tags: 1.4.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "svnqt/stringarray.hpp"
30
30
 
31
31
#include "svnqt/helper.hpp"
 
32
#include "svnqt/client_parameter.hpp"
32
33
 
33
34
namespace svn
34
35
{
35
 
void Client_impl::merge (const Path & path1, const Revision & revision1,
36
 
                 const Path & path2, const Revision & revision2,
37
 
                 const Path & localPath,
38
 
                 bool force,
39
 
                 Depth depth,
40
 
                 bool notice_ancestry,
41
 
                 bool dry_run,
42
 
                 bool record_only,
43
 
                 const StringArray&merge_options
44
 
                     ) throw (ClientException)
 
36
void Client_impl::merge (const MergeParameter&parameters) throw (ClientException)
45
37
{
46
38
    Pool pool;
47
39
    svn_error_t * error = 0;
48
40
#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1)
49
 
    error = svn_client_merge3(path1.cstr (),
50
 
                    revision1.revision (),
51
 
                    path2.cstr (),
52
 
                    revision2.revision (),
53
 
                    localPath.cstr (),
54
 
                    internal::DepthToSvn(depth),
55
 
                    !notice_ancestry,
56
 
                    force,
57
 
                    record_only,
58
 
                    dry_run,
59
 
                    merge_options.array(pool),
 
41
    error = svn_client_merge3(parameters.path1().cstr (),
 
42
                    parameters.revision1().revision(),
 
43
                    parameters.path2().cstr(),
 
44
                    parameters.revision2().revision(),
 
45
                    parameters.localPath().cstr (),
 
46
                    internal::DepthToSvn(parameters.depth()),
 
47
                    !parameters.notice_ancestry(),
 
48
                    parameters.force(),
 
49
                    parameters.record_only(),
 
50
                    parameters.dry_run(),
 
51
                    parameters.merge_options().array(pool),
60
52
                    *m_context,
61
53
                    pool);
62
54
#else
63
 
    bool recurse = depth==DepthInfinity;
64
 
    Q_UNUSED(record_only);
 
55
    bool recurse = parameters.depth()==DepthInfinity;
65
56
#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 4))
66
 
    error = svn_client_merge2(path1.cstr (),
67
 
                    revision1.revision (),
68
 
                    path2.cstr (),
69
 
                    revision2.revision (),
70
 
                    localPath.cstr (),
 
57
    error = svn_client_merge2(parameters.path1().cstr (),
 
58
                    parameters.revision1().revision (),
 
59
                    parameters.path2().cstr (),
 
60
                    parameters.revision2().revision(),
 
61
                    parameters.localPath().cstr (),
71
62
                    recurse,
72
 
                    !notice_ancestry,
73
 
                    force,
74
 
                    dry_run,
75
 
                    merge_options.array(pool),
 
63
                    !parameters.notice_ancestry(),
 
64
                    parameters.force(),
 
65
                    parameters.dry_run(),
 
66
                    parameters.merge_options().array(pool),
76
67
                    *m_context,
77
68
                    pool);
78
69
#else
79
 
    Q_UNUSED(merge_options);
80
 
    error = svn_client_merge(path1.cstr (),
81
 
                        revision1.revision (),
82
 
                        path2.cstr (),
83
 
                        revision2.revision (),
84
 
                        localPath.cstr (),
 
70
    error = svn_client_merge(parameters.path1().cstr (),
 
71
                        parameters.revision1().revision (),
 
72
                        parameters.path2().cstr (),
 
73
                        parameters.revision2().revision (),
 
74
                        parameters.localPath().cstr (),
85
75
                        recurse,
86
 
                        !notice_ancestry,
87
 
                        force,
88
 
                        dry_run,
 
76
                        !parameters.notice_ancestry(),
 
77
                        parameters.force(),
 
78
                        parameters.dry_run(),
89
79
                        *m_context,
90
80
                        pool);
91
81
#endif
96
86
    }
97
87
  }
98
88
 
99
 
  void Client_impl::merge_peg(const Path&src,
100
 
                              const RevisionRanges&ranges,
101
 
                    const Revision&peg,
102
 
                    const Path&targetWc,
103
 
                    Depth depth,
104
 
                    bool notice_ancestry,
105
 
                    bool dry_run,
106
 
                    bool force,
107
 
                    bool record_only,
108
 
                    const StringArray&merge_options
109
 
                   ) throw (ClientException)
 
89
  void Client_impl::merge_peg(const MergeParameter&parameters) throw (ClientException)
110
90
  {
111
91
#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1)
112
92
      Pool pool;
113
 
      internal::RevisionRangesToHash _rhash(ranges);
 
93
      internal::RevisionRangesToHash _rhash(parameters.revisions());
114
94
 
115
95
      svn_error_t*error;
116
96
 
117
97
      error = svn_client_merge_peg3(
118
 
                                    src.cstr(),
 
98
                                    parameters.path1().cstr(),
119
99
                                    _rhash.array(pool),
120
 
                                    peg,
121
 
                                    targetWc.cstr(),
122
 
                                    internal::DepthToSvn(depth),
123
 
                                    !notice_ancestry,
124
 
                                    force,
125
 
                                    record_only,
126
 
                                    dry_run,
127
 
                                    merge_options.array(pool),
 
100
                                    parameters.peg(),
 
101
                                    parameters.localPath().cstr(),
 
102
                                    internal::DepthToSvn(parameters.depth()),
 
103
                                    !parameters.notice_ancestry(),
 
104
                                    parameters.force(),
 
105
                                    parameters.record_only(),
 
106
                                    parameters.dry_run(),
 
107
                                    parameters.merge_options().array(pool),
128
108
                                    *m_context,
129
109
                                    pool
130
110
                                   );
132
112
          throw ClientException (error);
133
113
      }
134
114
#else
135
 
      Q_UNUSED(record_only);
136
 
      for (RevisionRanges::size_type i=0;i<ranges.count();++i) {
137
 
          merge_peg(src,ranges[i],peg,targetWc,depth,notice_ancestry,dry_run,force,merge_options);
 
115
      for (RevisionRanges::size_type i=0;i<parameters.revisions().count();++i) {
 
116
          merge_peg(parameters.path1(),parameters.revisions()[i],parameters.peg(),parameters.localPath(),
 
117
            parameters.depth(),parameters.notice_ancestry(),parameters.dry_run(),parameters.force(),parameters.merge_options());
138
118
      }
139
119
#endif
140
120
  }
151
131
                             ) throw (ClientException)
152
132
    {
153
133
#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1)
154
 
        RevisionRanges ranges;
155
 
        ranges.append(range);
156
 
        merge_peg(src,ranges,peg,targetWc,depth,notice_ancestry,dry_run,force,false,merge_options);
 
134
        Q_UNUSED(src);
 
135
        Q_UNUSED(range);
 
136
        Q_UNUSED(peg);
 
137
        Q_UNUSED(targetWc);
 
138
        Q_UNUSED(depth);
 
139
        Q_UNUSED(notice_ancestry);
 
140
        Q_UNUSED(dry_run);
 
141
        Q_UNUSED(force);
 
142
        Q_UNUSED(merge_options);
 
143
        qWarning()<<"This methode is obsolete!";
157
144
#else
158
145
        Pool pool;
159
146
        bool recurse=depth==DepthInfinity;