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