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