Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ScmProvider |
|
| 1.0;1 |
1 | package org.apache.maven.scm.provider; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | import org.apache.maven.scm.CommandParameters; | |
23 | import org.apache.maven.scm.ScmBranch; | |
24 | import org.apache.maven.scm.ScmBranchParameters; | |
25 | import org.apache.maven.scm.ScmException; | |
26 | import org.apache.maven.scm.ScmFileSet; | |
27 | import org.apache.maven.scm.ScmTagParameters; | |
28 | import org.apache.maven.scm.ScmVersion; | |
29 | import org.apache.maven.scm.command.add.AddScmResult; | |
30 | import org.apache.maven.scm.command.blame.BlameScmResult; | |
31 | import org.apache.maven.scm.command.branch.BranchScmResult; | |
32 | import org.apache.maven.scm.command.changelog.ChangeLogScmResult; | |
33 | import org.apache.maven.scm.command.checkin.CheckInScmResult; | |
34 | import org.apache.maven.scm.command.checkout.CheckOutScmResult; | |
35 | import org.apache.maven.scm.command.diff.DiffScmResult; | |
36 | import org.apache.maven.scm.command.edit.EditScmResult; | |
37 | import org.apache.maven.scm.command.export.ExportScmResult; | |
38 | import org.apache.maven.scm.command.info.InfoScmResult; | |
39 | import org.apache.maven.scm.command.list.ListScmResult; | |
40 | import org.apache.maven.scm.command.mkdir.MkdirScmResult; | |
41 | import org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult; | |
42 | import org.apache.maven.scm.command.remove.RemoveScmResult; | |
43 | import org.apache.maven.scm.command.status.StatusScmResult; | |
44 | import org.apache.maven.scm.command.tag.TagScmResult; | |
45 | import org.apache.maven.scm.command.unedit.UnEditScmResult; | |
46 | import org.apache.maven.scm.command.update.UpdateScmResult; | |
47 | import org.apache.maven.scm.log.ScmLogger; | |
48 | import org.apache.maven.scm.repository.ScmRepository; | |
49 | import org.apache.maven.scm.repository.ScmRepositoryException; | |
50 | import org.apache.maven.scm.repository.UnknownRepositoryStructure; | |
51 | ||
52 | import java.io.File; | |
53 | import java.util.Date; | |
54 | import java.util.List; | |
55 | ||
56 | /** | |
57 | * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> | |
58 | * @version $Id: ScmProvider.java 1306403 2012-03-28 15:13:37Z olamy $ | |
59 | */ | |
60 | public interface ScmProvider | |
61 | { | |
62 | String ROLE = ScmProvider.class.getName(); | |
63 | ||
64 | String getScmType(); | |
65 | ||
66 | /** | |
67 | * Add a logger listener. | |
68 | * | |
69 | * @param logger The logger | |
70 | */ | |
71 | void addListener( ScmLogger logger ); | |
72 | ||
73 | boolean requiresEditMode(); | |
74 | ||
75 | ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) | |
76 | throws ScmRepositoryException; | |
77 | ||
78 | ScmProviderRepository makeProviderScmRepository( File path ) | |
79 | throws ScmRepositoryException, UnknownRepositoryStructure; | |
80 | ||
81 | /** | |
82 | * Validate the scm url. | |
83 | * | |
84 | * @param scmSpecificUrl The SCM url | |
85 | * @param delimiter The delimiter used in the SCM url | |
86 | * @return Returns a list of messages if the validation failed | |
87 | */ | |
88 | List<String> validateScmUrl( String scmSpecificUrl, char delimiter ); | |
89 | ||
90 | /** | |
91 | * Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'. | |
92 | * | |
93 | * @return the scm reserved file name | |
94 | */ | |
95 | String getScmSpecificFilename(); | |
96 | ||
97 | /** | |
98 | * Check if this tag is valid for this SCM provider. | |
99 | * | |
100 | * @param tag tag name to check | |
101 | * @return true if tag is valid | |
102 | */ | |
103 | boolean validateTagName( String tag ); | |
104 | ||
105 | /** | |
106 | * Given a tag name, make it suitable for this SCM provider. For example, CVS converts "." into "_" | |
107 | * | |
108 | * @param tag input tag name | |
109 | * @return sanitized tag name | |
110 | */ | |
111 | String sanitizeTagName( String tag ); | |
112 | ||
113 | /** | |
114 | * Adds the given files to the source control system | |
115 | * | |
116 | * @param repository the source control system | |
117 | * @param fileSet the files to be added | |
118 | * @return an {@link AddScmResult} that contains the files that have been added | |
119 | * @throws ScmException if any | |
120 | */ | |
121 | AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) | |
122 | throws ScmException; | |
123 | ||
124 | /** | |
125 | * Adds the given files to the source control system | |
126 | * | |
127 | * @param repository the source control system | |
128 | * @param fileSet the files to be added | |
129 | * @param message a string that is a comment on the new added file | |
130 | * @return an {@link AddScmResult} that contains the files that have been added | |
131 | * @throws ScmException if any | |
132 | */ | |
133 | AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) | |
134 | throws ScmException; | |
135 | ||
136 | /** | |
137 | * Adds the given files to the source control system | |
138 | * | |
139 | * @param repository the source control system | |
140 | * @param fileSet the files to be added | |
141 | * @param commandParameters {@link CommandParameters} | |
142 | * @return an {@link AddScmResult} that contains the files that have been added | |
143 | * @throws ScmException if any | |
144 | */ | |
145 | AddScmResult add( ScmRepository repository, ScmFileSet fileSet, CommandParameters commandParameters ) | |
146 | throws ScmException; | |
147 | ||
148 | /** | |
149 | * Branch (or label in some systems) will create a branch of the source file with a certain branch name | |
150 | * | |
151 | * @param repository the source control system | |
152 | * @param fileSet the files to branch. Implementations can also give the changes | |
153 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
154 | * @param branchName the branch name to apply to the files | |
155 | * @return | |
156 | * @throws ScmException if any | |
157 | * @deprecated use {@link #branch(ScmRepository, ScmFileSet, String, String, ScmBranchParameters)} | |
158 | */ | |
159 | BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) | |
160 | throws ScmException; | |
161 | ||
162 | /** | |
163 | * Branch (or label in some systems) will create a branch of the source file with a certain branch name | |
164 | * | |
165 | * @param repository the source control system | |
166 | * @param fileSet the files to branch. Implementations can also give the changes | |
167 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
168 | * @param branchName the branch name to apply to the files | |
169 | * @param message the commit message used for the tag creation | |
170 | * @return | |
171 | * @throws ScmException if any | |
172 | * @deprecated use {@link #branch(ScmRepository, ScmFileSet, String, String, ScmBranchParameters)} | |
173 | */ | |
174 | BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) | |
175 | throws ScmException; | |
176 | ||
177 | /** | |
178 | * Branch (or label in some systems) will create a branch of the source file with a certain | |
179 | * branch name | |
180 | * | |
181 | * @param repository the source control system | |
182 | * @param fileSet the files to branch. Implementations can also give the changes from the | |
183 | * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
184 | * @param branchName the branch name to apply to the files | |
185 | * @param message the commit message used for the tag creation | |
186 | * @return | |
187 | * @throws ScmException if any | |
188 | * @since 1.3 | |
189 | */ | |
190 | BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, | |
191 | ScmBranchParameters scmBranchParameters ) | |
192 | throws ScmException; | |
193 | ||
194 | /** | |
195 | * Returns the changes that have happend in the source control system in a certain period of time. | |
196 | * This can be adding, removing, updating, ... of files | |
197 | * | |
198 | * @param repository the source control system | |
199 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
200 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
201 | * @param startDate the start date of the period | |
202 | * @param endDate the end date of the period | |
203 | * @param numDays the number days before the current time if startdate and enddate are null | |
204 | * @param branch the branch/tag name | |
205 | * @return The SCM result of the changelog command | |
206 | * @throws ScmException if any | |
207 | * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, | |
208 | * org.apache.maven.scm.ScmFileSet, java.util.Date, java.util.Date, int, org.apache.maven.scm.ScmBranch)} | |
209 | */ | |
210 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, | |
211 | int numDays, String branch ) | |
212 | throws ScmException; | |
213 | ||
214 | /** | |
215 | * Returns the changes that have happend in the source control system in a certain period of time. | |
216 | * This can be adding, removing, updating, ... of files | |
217 | * | |
218 | * @param repository the source control system | |
219 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
220 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
221 | * @param startDate the start date of the period | |
222 | * @param endDate the end date of the period | |
223 | * @param numDays the number days before the current time if startdate and enddate are null | |
224 | * @param branch the branch/tag | |
225 | * @return The SCM result of the changelog command | |
226 | * @throws ScmException if any | |
227 | */ | |
228 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, | |
229 | int numDays, ScmBranch branch ) | |
230 | throws ScmException; | |
231 | ||
232 | /** | |
233 | * Returns the changes that have happend in the source control system in a certain period of time. | |
234 | * This can be adding, removing, updating, ... of files | |
235 | * | |
236 | * @param repository the source control system | |
237 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
238 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
239 | * @param startDate the start date of the period | |
240 | * @param endDate the end date of the period | |
241 | * @param numDays the number days before the current time if startdate and enddate are null | |
242 | * @param branch the branch/tag name | |
243 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
244 | * @return The SCM result of the changelog command | |
245 | * @throws ScmException if any | |
246 | * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, | |
247 | * org.apache.maven.scm.ScmFileSet, java.util.Date, java.util.Date, int, org.apache.maven.scm.ScmBranch, String)} | |
248 | */ | |
249 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, | |
250 | int numDays, String branch, String datePattern ) | |
251 | throws ScmException; | |
252 | ||
253 | /** | |
254 | * Returns the changes that have happend in the source control system in a certain period of time. | |
255 | * This can be adding, removing, updating, ... of files | |
256 | * | |
257 | * @param repository the source control system | |
258 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
259 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
260 | * @param startDate the start date of the period | |
261 | * @param endDate the end date of the period | |
262 | * @param numDays the number days before the current time if startdate and enddate are null | |
263 | * @param branch the branch/tag | |
264 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
265 | * @return The SCM result of the changelog command | |
266 | * @throws ScmException if any | |
267 | */ | |
268 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, | |
269 | int numDays, ScmBranch branch, String datePattern ) | |
270 | throws ScmException; | |
271 | ||
272 | /** | |
273 | * Returns the changes that have happend in the source control system between two tags. | |
274 | * This can be adding, removing, updating, ... of files | |
275 | * | |
276 | * @param repository the source control system | |
277 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
278 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
279 | * @param startTag the start tag | |
280 | * @param endTag the end tag | |
281 | * @return The SCM result of the changelog command | |
282 | * @throws ScmException if any | |
283 | * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, | |
284 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, org.apache.maven.scm.ScmVersion)} | |
285 | */ | |
286 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag ) | |
287 | throws ScmException; | |
288 | ||
289 | /** | |
290 | * Returns the changes that have happend in the source control system between two tags. | |
291 | * This can be adding, removing, updating, ... of files | |
292 | * | |
293 | * @param repository the source control system | |
294 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
295 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
296 | * @param startVersion the start branch/tag/revision | |
297 | * @param endVersion the end branch/tag/revision | |
298 | * @return The SCM result of the changelog command | |
299 | * @throws ScmException if any | |
300 | */ | |
301 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, | |
302 | ScmVersion endVersion ) | |
303 | throws ScmException; | |
304 | ||
305 | /** | |
306 | * Returns the changes that have happend in the source control system between two tags. | |
307 | * This can be adding, removing, updating, ... of files | |
308 | * | |
309 | * @param repository the source control system | |
310 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
311 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
312 | * @param startTag the start tag | |
313 | * @param endTag the end tag | |
314 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
315 | * @return | |
316 | * @throws ScmException if any | |
317 | * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, | |
318 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, org.apache.maven.scm.ScmVersion, String)} | |
319 | */ | |
320 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag, | |
321 | String datePattern ) | |
322 | throws ScmException; | |
323 | ||
324 | /** | |
325 | * Returns the changes that have happend in the source control system between two tags. | |
326 | * This can be adding, removing, updating, ... of files | |
327 | * | |
328 | * @param repository the source control system | |
329 | * @param fileSet the files to know the changes about. Implementations can also give the changes | |
330 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
331 | * @param startRevision the start revision | |
332 | * @param endRevision the end revision | |
333 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
334 | * @return | |
335 | * @throws ScmException if any | |
336 | */ | |
337 | ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, | |
338 | ScmVersion endRevision, String datePattern ) | |
339 | throws ScmException; | |
340 | ||
341 | /** | |
342 | * Save the changes you have done into the repository. This will create a new version of the file or | |
343 | * directory in the repository. | |
344 | * <p/> | |
345 | * When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. | |
346 | * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet | |
347 | * are committed. | |
348 | * | |
349 | * @param repository the source control system | |
350 | * @param fileSet the files to check in (sometimes called commit) | |
351 | * @param tag tag or revision | |
352 | * @param message a string that is a comment on the changes that where done | |
353 | * @return | |
354 | * @throws ScmException if any | |
355 | * @deprecated you must use {@link ScmProvider#checkIn(org.apache.maven.scm.repository.ScmRepository, | |
356 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)} | |
357 | */ | |
358 | CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String tag, String message ) | |
359 | throws ScmException; | |
360 | ||
361 | /** | |
362 | * Save the changes you have done into the repository. This will create a new version of the file or | |
363 | * directory in the repository. | |
364 | * <p/> | |
365 | * When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. | |
366 | * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet | |
367 | * are committed. | |
368 | * | |
369 | * @param repository the source control system | |
370 | * @param fileSet the files to check in (sometimes called commit) | |
371 | * @param message a string that is a comment on the changes that where done | |
372 | * @return | |
373 | * @throws ScmException if any | |
374 | */ | |
375 | CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) | |
376 | throws ScmException; | |
377 | ||
378 | /** | |
379 | * Save the changes you have done into the repository. This will create a new version of the file or | |
380 | * directory in the repository. | |
381 | * <p/> | |
382 | * When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. | |
383 | * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet | |
384 | * are committed. | |
385 | * | |
386 | * @param repository the source control system | |
387 | * @param fileSet the files to check in (sometimes called commit) | |
388 | * @param revision branch/tag/revision | |
389 | * @param message a string that is a comment on the changes that where done | |
390 | * @return | |
391 | * @throws ScmException if any | |
392 | */ | |
393 | CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message ) | |
394 | throws ScmException; | |
395 | ||
396 | /** | |
397 | * Create a copy of the repository on your local machine | |
398 | * | |
399 | * @param repository the source control system | |
400 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
401 | * @param tag get the version defined by the tag | |
402 | * @return | |
403 | * @throws ScmException if any | |
404 | * @deprecated you must use {@link ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository, | |
405 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)} | |
406 | */ | |
407 | CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag ) | |
408 | throws ScmException; | |
409 | ||
410 | /** | |
411 | * Create a copy of the repository on your local machine | |
412 | * | |
413 | * @param repository the source control system | |
414 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
415 | * @return | |
416 | * @throws ScmException if any | |
417 | */ | |
418 | CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) | |
419 | throws ScmException; | |
420 | ||
421 | /** | |
422 | * Create a copy of the repository on your local machine | |
423 | * | |
424 | * @param repository the source control system | |
425 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
426 | * @param version get the version defined by the revision, branch or tag | |
427 | * @return | |
428 | * @throws ScmException if any | |
429 | */ | |
430 | CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) | |
431 | throws ScmException; | |
432 | ||
433 | /** | |
434 | * Create a copy of the repository on your local machine. | |
435 | * | |
436 | * @param scmRepository the source control system | |
437 | * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
438 | * @param tag tag or revision | |
439 | * @param recursive whether to check out recursively | |
440 | * @return | |
441 | * @throws ScmException if any | |
442 | * @deprecated you must use {@link ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository, | |
443 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, boolean)} | |
444 | */ | |
445 | CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, String tag, boolean recursive ) | |
446 | throws ScmException; | |
447 | ||
448 | /** | |
449 | * Create a copy of the repository on your local machine. | |
450 | * | |
451 | * @param scmRepository the source control system | |
452 | * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
453 | * @param recursive whether to check out recursively | |
454 | * @return | |
455 | * @throws ScmException if any | |
456 | */ | |
457 | CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, boolean recursive ) | |
458 | throws ScmException; | |
459 | ||
460 | /** | |
461 | * Create a copy of the repository on your local machine. | |
462 | * | |
463 | * @param scmRepository the source control system | |
464 | * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
465 | * @param version get the version defined by the revision, branch or tag | |
466 | * @param recursive whether to check out recursively | |
467 | * @return | |
468 | * @throws ScmException if any | |
469 | */ | |
470 | CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion version, | |
471 | boolean recursive ) | |
472 | throws ScmException; | |
473 | ||
474 | /** | |
475 | * Create a diff between two branch/tag/revision. | |
476 | * | |
477 | * @param scmRepository the source control system | |
478 | * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
479 | * @param startRevision the start revision | |
480 | * @param endRevision the end revision | |
481 | * @return | |
482 | * @throws ScmException if any | |
483 | * @deprecated you must use {@link ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository, | |
484 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, org.apache.maven.scm.ScmVersion)} | |
485 | */ | |
486 | DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, String startRevision, String endRevision ) | |
487 | throws ScmException; | |
488 | ||
489 | /** | |
490 | * Create a diff between two branch/tag/revision. | |
491 | * | |
492 | * @param scmRepository the source control system | |
493 | * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
494 | * @param startVersion the start branch/tag/revision | |
495 | * @param endVersion the end branch/tag/revision | |
496 | * @return | |
497 | * @throws ScmException if any | |
498 | */ | |
499 | DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion startVersion, | |
500 | ScmVersion endVersion ) | |
501 | throws ScmException; | |
502 | ||
503 | /** | |
504 | * Create an exported copy of the repository on your local machine | |
505 | * | |
506 | * @param repository the source control system | |
507 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
508 | * @param tag get the version defined by the tag | |
509 | * @return | |
510 | * @throws ScmException if any | |
511 | * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository, | |
512 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)} | |
513 | */ | |
514 | ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag ) | |
515 | throws ScmException; | |
516 | ||
517 | /** | |
518 | * Create an exported copy of the repository on your local machine | |
519 | * | |
520 | * @param repository the source control system | |
521 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
522 | * @return | |
523 | * @throws ScmException if any | |
524 | */ | |
525 | ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) | |
526 | throws ScmException; | |
527 | ||
528 | /** | |
529 | * Create an exported copy of the repository on your local machine | |
530 | * | |
531 | * @param repository the source control system | |
532 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
533 | * @param version get the version defined by the branch/tag/revision | |
534 | * @return | |
535 | * @throws ScmException if any | |
536 | */ | |
537 | ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) | |
538 | throws ScmException; | |
539 | ||
540 | /** | |
541 | * Create an exported copy of the repository on your local machine | |
542 | * | |
543 | * @param repository the source control system | |
544 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
545 | * @param tag get the version defined by the tag | |
546 | * @param outputDirectory the directory where the export will be stored | |
547 | * @return | |
548 | * @throws ScmException if any | |
549 | * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository, | |
550 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)} | |
551 | */ | |
552 | ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory ) | |
553 | throws ScmException; | |
554 | ||
555 | /** | |
556 | * Create an exported copy of the repository on your local machine | |
557 | * | |
558 | * @param repository the source control system | |
559 | * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location | |
560 | * @param version get the version defined by the branch/tag/revision | |
561 | * @param outputDirectory the directory where the export will be stored | |
562 | * @return | |
563 | * @throws ScmException if any | |
564 | */ | |
565 | ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) | |
566 | throws ScmException; | |
567 | ||
568 | /** | |
569 | * Removes the given files from the source control system | |
570 | * | |
571 | * @param repository the source control system | |
572 | * @param fileSet the files to be removed | |
573 | * @param message | |
574 | * @return | |
575 | * @throws ScmException if any | |
576 | */ | |
577 | RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) | |
578 | throws ScmException; | |
579 | ||
580 | /** | |
581 | * Returns the status of the files in the source control system. The state of each file can be one | |
582 | * of the {@link org.apache.maven.scm.ScmFileStatus} flags. | |
583 | * | |
584 | * @param repository the source control system | |
585 | * @param fileSet the files to know the status about. Implementations can also give the changes | |
586 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
587 | * @return | |
588 | * @throws ScmException if any | |
589 | */ | |
590 | StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) | |
591 | throws ScmException; | |
592 | ||
593 | /** | |
594 | * Tag (or label in some systems) will tag the source file with a certain tag | |
595 | * | |
596 | * @param repository the source control system | |
597 | * @param fileSet the files to tag. Implementations can also give the changes | |
598 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
599 | * @param tagName the tag name to apply to the files | |
600 | * @return | |
601 | * @throws ScmException if any | |
602 | * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)} | |
603 | */ | |
604 | TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) | |
605 | throws ScmException; | |
606 | ||
607 | /** | |
608 | * Tag (or label in some systems) will tag the source file with a certain tag | |
609 | * | |
610 | * @param repository the source control system | |
611 | * @param fileSet the files to tag. Implementations can also give the changes | |
612 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
613 | * @param tagName the tag name to apply to the files | |
614 | * @param message the commit message used for the tag creation | |
615 | * @return | |
616 | * @throws ScmException if any | |
617 | * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)} | |
618 | */ | |
619 | TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) | |
620 | throws ScmException; | |
621 | ||
622 | /** | |
623 | * Tag (or label in some systems) will tag the source file with a certain tag | |
624 | * | |
625 | * @param repository the source control system | |
626 | * @param fileSet the files to tag. Implementations can also give the changes | |
627 | * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. | |
628 | * @param tagName the tag name to apply to the files | |
629 | * @param scmTagParameters bean to pass some paramters for tagging {@link ScmTagParameters} | |
630 | * @return | |
631 | * @throws ScmException if any | |
632 | * @since 1.2 | |
633 | */ | |
634 | TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) | |
635 | throws ScmException; | |
636 | ||
637 | /** | |
638 | * Updates the copy on the local machine with the changes in the repository | |
639 | * | |
640 | * @param repository the source control system | |
641 | * @param fileSet location of your local copy | |
642 | * @return | |
643 | * @throws ScmException if any | |
644 | */ | |
645 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) | |
646 | throws ScmException; | |
647 | ||
648 | /** | |
649 | * Updates the copy on the local machine with the changes in the repository | |
650 | * | |
651 | * @param repository the source control system | |
652 | * @param fileSet location of your local copy | |
653 | * @param tag use the version defined by the tag | |
654 | * @return | |
655 | * @throws ScmException if any | |
656 | * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, | |
657 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)} | |
658 | */ | |
659 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag ) | |
660 | throws ScmException; | |
661 | ||
662 | /** | |
663 | * Updates the copy on the local machine with the changes in the repository | |
664 | * | |
665 | * @param repository the source control system | |
666 | * @param fileSet location of your local copy | |
667 | * @param version use the version defined by the branch/tag/revision | |
668 | * @return | |
669 | * @throws ScmException if any | |
670 | */ | |
671 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) | |
672 | throws ScmException; | |
673 | ||
674 | /** | |
675 | * Updates the copy on the local machine with the changes in the repository | |
676 | * | |
677 | * @param repository the source control system | |
678 | * @param fileSet location of your local copy | |
679 | * @param tag use the version defined by the tag | |
680 | * @param runChangelog Run the changelog command after the update | |
681 | * @return | |
682 | * @throws ScmException if any | |
683 | * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, | |
684 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, boolean)} | |
685 | */ | |
686 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog ) | |
687 | throws ScmException; | |
688 | ||
689 | /** | |
690 | * Updates the copy on the local machine with the changes in the repository | |
691 | * | |
692 | * @param repository the source control system | |
693 | * @param fileSet location of your local copy | |
694 | * @param runChangelog Run the changelog command after the update | |
695 | * @return | |
696 | * @throws ScmException if any | |
697 | */ | |
698 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) | |
699 | throws ScmException; | |
700 | ||
701 | /** | |
702 | * Updates the copy on the local machine with the changes in the repository | |
703 | * | |
704 | * @param repository the source control system | |
705 | * @param fileSet location of your local copy | |
706 | * @param version use the version defined by the branch/tag/revision | |
707 | * @param runChangelog Run the changelog command after the update | |
708 | * @return | |
709 | * @throws ScmException if any | |
710 | */ | |
711 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) | |
712 | throws ScmException; | |
713 | ||
714 | /** | |
715 | * Updates the copy on the local machine with the changes in the repository | |
716 | * | |
717 | * @param repository the source control system | |
718 | * @param fileSet location of your local copy | |
719 | * @param tag use the version defined by the tag | |
720 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
721 | * @return | |
722 | * @throws ScmException if any | |
723 | * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, | |
724 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)} | |
725 | */ | |
726 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern ) | |
727 | throws ScmException; | |
728 | ||
729 | /** | |
730 | * Updates the copy on the local machine with the changes in the repository | |
731 | * | |
732 | * @param repository the source control system | |
733 | * @param fileSet location of your local copy | |
734 | * @param version use the version defined by the branch/tag/revision | |
735 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
736 | * @return | |
737 | * @throws ScmException if any | |
738 | */ | |
739 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) | |
740 | throws ScmException; | |
741 | ||
742 | /** | |
743 | * Updates the copy on the local machine with the changes in the repository | |
744 | * | |
745 | * @param repository the source control system | |
746 | * @param fileSet location of your local copy | |
747 | * @param tag use the version defined by the tag | |
748 | * @param lastUpdate | |
749 | * @return | |
750 | * @throws ScmException if any | |
751 | * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, | |
752 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, java.util.Date)} | |
753 | */ | |
754 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate ) | |
755 | throws ScmException; | |
756 | ||
757 | /** | |
758 | * Updates the copy on the local machine with the changes in the repository | |
759 | * | |
760 | * @param repository the source control system | |
761 | * @param fileSet location of your local copy | |
762 | * @param version use the version defined by the branch/tag/revision | |
763 | * @param lastUpdate | |
764 | * @return | |
765 | * @throws ScmException if any | |
766 | */ | |
767 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) | |
768 | throws ScmException; | |
769 | ||
770 | /** | |
771 | * Updates the copy on the local machine with the changes in the repository | |
772 | * | |
773 | * @param repository the source control system | |
774 | * @param fileSet location of your local copy | |
775 | * @param tag use the version defined by the tag | |
776 | * @param lastUpdate Date of last update | |
777 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
778 | * @return | |
779 | * @throws ScmException if any | |
780 | * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, | |
781 | * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, java.util.Date, String)} | |
782 | */ | |
783 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate, | |
784 | String datePattern ) | |
785 | throws ScmException; | |
786 | ||
787 | /** | |
788 | * Updates the copy on the local machine with the changes in the repository | |
789 | * | |
790 | * @param repository the source control system | |
791 | * @param fileSet location of your local copy | |
792 | * @param version use the version defined by the branch/tag/revision | |
793 | * @param lastUpdate Date of last update | |
794 | * @param datePattern the date pattern use in changelog output returned by scm tool | |
795 | * @return | |
796 | * @throws ScmException if any | |
797 | */ | |
798 | UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, | |
799 | String datePattern ) | |
800 | throws ScmException; | |
801 | ||
802 | /** | |
803 | * Make a file editable. This is used in source control systems where you look at read-only files | |
804 | * and you need to make them not read-only anymore before you can edit them. This can also mean | |
805 | * that no other user in the system can make the file not read-only anymore. | |
806 | * | |
807 | * @param repository the source control system | |
808 | * @param fileSet the files to make editable | |
809 | * @return | |
810 | * @throws ScmException if any | |
811 | */ | |
812 | EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) | |
813 | throws ScmException; | |
814 | ||
815 | /** | |
816 | * Make a file no longer editable. This is the conterpart of {@link #edit( | |
817 | *org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)}. | |
818 | * It makes the file read-only again. | |
819 | * | |
820 | * @param repository the source control system | |
821 | * @param fileSet the files to make uneditable | |
822 | * @return | |
823 | * @throws ScmException if any | |
824 | */ | |
825 | UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) | |
826 | throws ScmException; | |
827 | ||
828 | /** | |
829 | * List each element (files and directories) of <B>fileSet</B> as they exist in the repository. | |
830 | * | |
831 | * @param repository the source control system | |
832 | * @param fileSet the files to list | |
833 | * @param recursive descend recursively | |
834 | * @param tag use the version defined by the tag | |
835 | * @return the list of files in the repository | |
836 | * @deprecated you must use {@link ScmProvider#list(org.apache.maven.scm.repository.ScmRepository, | |
837 | * org.apache.maven.scm.ScmFileSet, boolean, org.apache.maven.scm.ScmVersion)} | |
838 | */ | |
839 | ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag ) | |
840 | throws ScmException; | |
841 | ||
842 | /** | |
843 | * List each element (files and directories) of <B>fileSet</B> as they exist in the repository. | |
844 | * | |
845 | * @param repository the source control system | |
846 | * @param fileSet the files to list | |
847 | * @param recursive descend recursively | |
848 | * @param version use the version defined by the branch/tag/revision | |
849 | * @return the list of files in the repository | |
850 | * @throws ScmException if any | |
851 | */ | |
852 | ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) | |
853 | throws ScmException; | |
854 | ||
855 | /** | |
856 | * Returns the blame of specified file | |
857 | * | |
858 | * @param repository the source control system | |
859 | * @param fileSet location of your local copy | |
860 | * @param filename file | |
861 | * @return blame for specified file | |
862 | * @throws ScmException | |
863 | * @since 1.4 | |
864 | */ | |
865 | BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename ) | |
866 | throws ScmException; | |
867 | ||
868 | /** | |
869 | * Create directory/directories in the repository. | |
870 | * | |
871 | * @param repository | |
872 | * @param fileSet | |
873 | * @param createInLocal | |
874 | * @param messageFile | |
875 | * @return | |
876 | * @throws ScmException | |
877 | */ | |
878 | MkdirScmResult mkdir( ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal ) | |
879 | throws ScmException; | |
880 | ||
881 | /** | |
882 | * @param repository the source control system | |
883 | * @param fileSet location of your local copy | |
884 | * @param parameters some parameters (not use currently but for future use) | |
885 | * @return if the scm implementation doesn't support "info" result will <code>null</code> | |
886 | * @throws ScmException | |
887 | * @since 1.5 | |
888 | */ | |
889 | InfoScmResult info( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) | |
890 | throws ScmException; | |
891 | ||
892 | /** | |
893 | * @param repository the source control system | |
894 | * @param fileSet not use currently but for future use | |
895 | * @param parameters some parameters (not use currently but for future use) | |
896 | * @return if the scm implementation doesn't support "info" result will <code>null</code> | |
897 | * @throws ScmException | |
898 | * @since 1.6 | |
899 | */ | |
900 | RemoteInfoScmResult remoteInfo( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) | |
901 | throws ScmException; | |
902 | } |