001    package org.apache.maven.scm.provider;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     * http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    import org.apache.maven.scm.CommandParameters;
023    import org.apache.maven.scm.ScmBranch;
024    import org.apache.maven.scm.ScmBranchParameters;
025    import org.apache.maven.scm.ScmException;
026    import org.apache.maven.scm.ScmFileSet;
027    import org.apache.maven.scm.ScmTagParameters;
028    import org.apache.maven.scm.ScmVersion;
029    import org.apache.maven.scm.command.add.AddScmResult;
030    import org.apache.maven.scm.command.blame.BlameScmRequest;
031    import org.apache.maven.scm.command.blame.BlameScmResult;
032    import org.apache.maven.scm.command.branch.BranchScmResult;
033    import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
034    import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
035    import org.apache.maven.scm.command.checkin.CheckInScmResult;
036    import org.apache.maven.scm.command.checkout.CheckOutScmResult;
037    import org.apache.maven.scm.command.diff.DiffScmResult;
038    import org.apache.maven.scm.command.edit.EditScmResult;
039    import org.apache.maven.scm.command.export.ExportScmResult;
040    import org.apache.maven.scm.command.info.InfoScmResult;
041    import org.apache.maven.scm.command.list.ListScmResult;
042    import org.apache.maven.scm.command.mkdir.MkdirScmResult;
043    import org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult;
044    import org.apache.maven.scm.command.remove.RemoveScmResult;
045    import org.apache.maven.scm.command.status.StatusScmResult;
046    import org.apache.maven.scm.command.tag.TagScmResult;
047    import org.apache.maven.scm.command.unedit.UnEditScmResult;
048    import org.apache.maven.scm.command.update.UpdateScmResult;
049    import org.apache.maven.scm.log.ScmLogger;
050    import org.apache.maven.scm.repository.ScmRepository;
051    import org.apache.maven.scm.repository.ScmRepositoryException;
052    import org.apache.maven.scm.repository.UnknownRepositoryStructure;
053    
054    import java.io.File;
055    import java.util.Date;
056    import java.util.List;
057    
058    /**
059     * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
060     * @version $Id: ScmProvider.java 1354687 2012-06-27 19:38:56Z olamy $
061     */
062    public interface ScmProvider
063    {
064        String ROLE = ScmProvider.class.getName();
065    
066        String getScmType();
067    
068        /**
069         * Add a logger listener.
070         *
071         * @param logger The logger
072         */
073        void addListener( ScmLogger logger );
074    
075        boolean requiresEditMode();
076    
077        ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter )
078            throws ScmRepositoryException;
079    
080        ScmProviderRepository makeProviderScmRepository( File path )
081            throws ScmRepositoryException, UnknownRepositoryStructure;
082    
083        /**
084         * Validate the scm url.
085         *
086         * @param scmSpecificUrl The SCM url
087         * @param delimiter      The delimiter used in the SCM url
088         * @return Returns a list of messages if the validation failed
089         */
090        List<String> validateScmUrl( String scmSpecificUrl, char delimiter );
091    
092        /**
093         * Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'.
094         *
095         * @return the scm reserved file name
096         */
097        String getScmSpecificFilename();
098    
099        /**
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, org.apache.maven.scm.ScmBranch)}
210         */
211        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
212                                      int numDays, String branch )
213            throws ScmException;
214    
215        /**
216         * Returns the changes that have happend in the source control system in a certain period of time.
217         * This can be adding, removing, updating, ... of files
218         *
219         * @param repository the source control system
220         * @param fileSet    the files to know the changes about. Implementations can also give the changes
221         *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
222         * @param startDate  the start date of the period
223         * @param endDate    the end date of the period
224         * @param numDays    the number days before the current time if startdate and enddate are null
225         * @param branch     the branch/tag
226         * @return The SCM result of the changelog command
227         * @throws ScmException if any
228         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
229         */
230        @Deprecated
231        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
232                                      int numDays, ScmBranch branch )
233            throws ScmException;
234    
235        /**
236         * Returns the changes that have happend in the source control system in a certain period of time.
237         * This can be adding, removing, updating, ... of files
238         *
239         * @param repository  the source control system
240         * @param fileSet     the files to know the changes about. Implementations can also give the changes
241         *                    from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
242         * @param startDate   the start date of the period
243         * @param endDate     the end date of the period
244         * @param numDays     the number days before the current time if startdate and enddate are null
245         * @param branch      the branch/tag name
246         * @param datePattern the date pattern use in changelog output returned by scm tool
247         * @return The SCM result of the changelog command
248         * @throws ScmException if any
249         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
250         */
251        @Deprecated
252        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
253                                      int numDays, String branch, String datePattern )
254            throws ScmException;
255    
256        /**
257         * Returns the changes that have happend in the source control system in a certain period of time.
258         * This can be adding, removing, updating, ... of files
259         *
260         * @param repository  the source control system
261         * @param fileSet     the files to know the changes about. Implementations can also give the changes
262         *                    from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
263         * @param startDate   the start date of the period
264         * @param endDate     the end date of the period
265         * @param numDays     the number days before the current time if startdate and enddate are null
266         * @param branch      the branch/tag
267         * @param datePattern the date pattern use in changelog output returned by scm tool
268         * @return The SCM result of the changelog command
269         * @throws ScmException if any
270         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
271         */
272        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
273                                      int numDays, ScmBranch branch, String datePattern )
274            throws ScmException;
275    
276        /**
277         * Returns the changes that have happend in the source control system in a certain period of time.
278         * This can be adding, removing, updating, ... of files
279         *
280         * @param scmRequest request wrapping detailed parameters for the changelog command
281         * @return The SCM result of the changelog command
282         * @throws ScmException if any
283         * @since 1.8
284         */
285        ChangeLogScmResult changeLog( ChangeLogScmRequest scmRequest )
286            throws ScmException;
287    
288        /**
289         * Returns the changes that have happend in the source control system between two tags.
290         * This can be adding, removing, updating, ... of files
291         *
292         * @param repository the source control system
293         * @param fileSet    the files to know the changes about. Implementations can also give the changes
294         *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
295         * @param startTag   the start tag
296         * @param endTag     the end tag
297         * @return The SCM result of the changelog command
298         * @throws ScmException if any
299         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
300         */
301        @Deprecated
302        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag )
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 startVersion the start branch/tag/revision
313         * @param endVersion   the end branch/tag/revision
314         * @return The SCM result of the changelog command
315         * @throws ScmException if any
316         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
317         */
318        @Deprecated
319        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
320                                      ScmVersion endVersion )
321            throws ScmException;
322    
323        /**
324         * Returns the changes that have happend in the source control system between two tags.
325         * This can be adding, removing, updating, ... of files
326         *
327         * @param repository  the source control system
328         * @param fileSet     the files to know the changes about. Implementations can also give the changes
329         *                    from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
330         * @param startTag    the start tag
331         * @param endTag      the end tag
332         * @param datePattern the date pattern use in changelog output returned by scm tool
333         * @return
334         * @throws ScmException if any
335         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
336         */
337        @Deprecated
338        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag,
339                                      String datePattern )
340            throws ScmException;
341    
342        /**
343         * Returns the changes that have happend in the source control system between two tags.
344         * This can be adding, removing, updating, ... of files
345         *
346         * @param repository    the source control system
347         * @param fileSet       the files to know the changes about. Implementations can also give the changes
348         *                      from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
349         * @param startRevision the start revision
350         * @param endRevision   the end revision
351         * @param datePattern   the date pattern use in changelog output returned by scm tool
352         * @return
353         * @throws ScmException if any
354         * @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
355         */
356        @Deprecated
357        ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision,
358                                      ScmVersion endRevision, String datePattern )
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 tag        tag or revision
372         * @param message    a string that is a comment on the changes that where done
373         * @return
374         * @throws ScmException if any
375         * @deprecated you must use {@link ScmProvider#checkIn(org.apache.maven.scm.repository.ScmRepository,
376         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)}
377         */
378        CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String tag, String message )
379            throws ScmException;
380    
381        /**
382         * Save the changes you have done into the repository. This will create a new version of the file or
383         * directory in the repository.
384         * <p/>
385         * When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed.
386         * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet
387         * are committed.
388         *
389         * @param repository the source control system
390         * @param fileSet    the files to check in (sometimes called commit)
391         * @param message    a string that is a comment on the changes that where done
392         * @return
393         * @throws ScmException if any
394         */
395        CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message )
396            throws ScmException;
397    
398        /**
399         * Save the changes you have done into the repository. This will create a new version of the file or
400         * directory in the repository.
401         * <p/>
402         * When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed.
403         * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet
404         * are committed.
405         *
406         * @param repository the source control system
407         * @param fileSet    the files to check in (sometimes called commit)
408         * @param revision   branch/tag/revision
409         * @param message    a string that is a comment on the changes that where done
410         * @return
411         * @throws ScmException if any
412         */
413        CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message )
414            throws ScmException;
415    
416        /**
417         * Create a copy of the repository on your local machine
418         *
419         * @param repository the source control system
420         * @param fileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
421         * @param tag        get the version defined by the tag
422         * @return
423         * @throws ScmException if any
424         * @deprecated you must use {@link ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository,
425         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)}
426         */
427        CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag )
428            throws ScmException;
429    
430        /**
431         * Create a copy of the repository on your local machine
432         *
433         * @param repository the source control system
434         * @param fileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
435         * @return
436         * @throws ScmException if any
437         */
438        CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet )
439            throws ScmException;
440    
441        /**
442         * Create a copy of the repository on your local machine
443         *
444         * @param repository the source control system
445         * @param fileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
446         * @param version    get the version defined by the revision, branch or tag
447         * @return
448         * @throws ScmException if any
449         */
450        CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
451            throws ScmException;
452    
453        /**
454         * Create a copy of the repository on your local machine.
455         *
456         * @param scmRepository the source control system
457         * @param scmFileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
458         * @param tag           tag or revision
459         * @param recursive     whether to check out recursively
460         * @return
461         * @throws ScmException if any
462         * @deprecated you must use {@link ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository,
463         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, boolean)}
464         */
465        CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, String tag, boolean recursive )
466            throws ScmException;
467    
468        /**
469         * Create a copy of the repository on your local machine.
470         *
471         * @param scmRepository the source control system
472         * @param scmFileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
473         * @param recursive     whether to check out recursively
474         * @return
475         * @throws ScmException if any
476         */
477        CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, boolean recursive )
478            throws ScmException;
479    
480        /**
481         * Create a copy of the repository on your local machine.
482         *
483         * @param scmRepository the source control system
484         * @param scmFileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
485         * @param version       get the version defined by the revision, branch or tag
486         * @param recursive     whether to check out recursively
487         * @return
488         * @throws ScmException if any
489         */
490        CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion version,
491                                    boolean recursive )
492            throws ScmException;
493    
494        /**
495         * Create a diff between two branch/tag/revision.
496         *
497         * @param scmRepository the source control system
498         * @param scmFileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
499         * @param startRevision the start revision
500         * @param endRevision   the end revision
501         * @return
502         * @throws ScmException if any
503         * @deprecated you must use {@link ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository,
504         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, org.apache.maven.scm.ScmVersion)}
505         */
506        DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, String startRevision, String endRevision )
507            throws ScmException;
508    
509        /**
510         * Create a diff between two branch/tag/revision.
511         *
512         * @param scmRepository the source control system
513         * @param scmFileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
514         * @param startVersion  the start branch/tag/revision
515         * @param endVersion    the end branch/tag/revision
516         * @return
517         * @throws ScmException if any
518         */
519        DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion startVersion,
520                            ScmVersion endVersion )
521            throws ScmException;
522    
523        /**
524         * Create an exported copy of the repository on your local machine
525         *
526         * @param repository the source control system
527         * @param fileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
528         * @param tag        get the version defined by the tag
529         * @return
530         * @throws ScmException if any
531         * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository,
532         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)}
533         */
534        ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag )
535            throws ScmException;
536    
537        /**
538         * Create an exported copy of the repository on your local machine
539         *
540         * @param repository the source control system
541         * @param fileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
542         * @return
543         * @throws ScmException if any
544         */
545        ExportScmResult export( ScmRepository repository, ScmFileSet fileSet )
546            throws ScmException;
547    
548        /**
549         * Create an exported copy of the repository on your local machine
550         *
551         * @param repository the source control system
552         * @param fileSet    the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
553         * @param version    get the version defined by the branch/tag/revision
554         * @return
555         * @throws ScmException if any
556         */
557        ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
558            throws ScmException;
559    
560        /**
561         * Create an exported copy of the repository on your local machine
562         *
563         * @param repository      the source control system
564         * @param fileSet         the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
565         * @param tag             get the version defined by the tag
566         * @param outputDirectory the directory where the export will be stored
567         * @return
568         * @throws ScmException if any
569         * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository,
570         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)}
571         */
572        ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory )
573            throws ScmException;
574    
575        /**
576         * Create an exported copy of the repository on your local machine
577         *
578         * @param repository      the source control system
579         * @param fileSet         the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
580         * @param version         get the version defined by the branch/tag/revision
581         * @param outputDirectory the directory where the export will be stored
582         * @return
583         * @throws ScmException if any
584         */
585        ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory )
586            throws ScmException;
587    
588        /**
589         * Removes the given files from the source control system
590         *
591         * @param repository the source control system
592         * @param fileSet    the files to be removed
593         * @param message
594         * @return
595         * @throws ScmException if any
596         */
597        RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message )
598            throws ScmException;
599    
600        /**
601         * Returns the status of the files in the source control system. The state of each file can be one
602         * of the {@link org.apache.maven.scm.ScmFileStatus} flags.
603         *
604         * @param repository the source control system
605         * @param fileSet    the files to know the status about. Implementations can also give the changes
606         *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
607         * @return
608         * @throws ScmException if any
609         */
610        StatusScmResult status( ScmRepository repository, ScmFileSet fileSet )
611            throws ScmException;
612    
613        /**
614         * Tag (or label in some systems) will tag the source file with a certain tag
615         *
616         * @param repository the source control system
617         * @param fileSet    the files to tag. Implementations can also give the changes
618         *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
619         * @param tagName    the tag name to apply to the files
620         * @return
621         * @throws ScmException if any
622         * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)}
623         */
624        TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName )
625            throws ScmException;
626    
627        /**
628         * Tag (or label in some systems) will tag the source file with a certain tag
629         *
630         * @param repository the source control system
631         * @param fileSet    the files to tag. Implementations can also give the changes
632         *                   from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
633         * @param tagName    the tag name to apply to the files
634         * @param message    the commit message used for the tag creation
635         * @return
636         * @throws ScmException if any
637         * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)}
638         */
639        TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message )
640            throws ScmException;
641    
642        /**
643         * Tag (or label in some systems) will tag the source file with a certain tag
644         *
645         * @param repository       the source control system
646         * @param fileSet          the files to tag. Implementations can also give the changes
647         *                         from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
648         * @param tagName          the tag name to apply to the files
649         * @param scmTagParameters bean to pass some paramters for tagging {@link ScmTagParameters}
650         * @return
651         * @throws ScmException if any
652         * @since 1.2
653         */
654        TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters )
655            throws ScmException;
656    
657        /**
658         * Updates the copy on the local machine with the changes in the repository
659         *
660         * @param repository the source control system
661         * @param fileSet    location of your local copy
662         * @return
663         * @throws ScmException if any
664         */
665        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet )
666            throws ScmException;
667    
668        /**
669         * Updates the copy on the local machine with the changes in the repository
670         *
671         * @param repository the source control system
672         * @param fileSet    location of your local copy
673         * @param tag        use the version defined by the tag
674         * @return
675         * @throws ScmException if any
676         * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,
677         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)}
678         */
679        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag )
680            throws ScmException;
681    
682        /**
683         * Updates the copy on the local machine with the changes in the repository
684         *
685         * @param repository the source control system
686         * @param fileSet    location of your local copy
687         * @param version    use the version defined by the branch/tag/revision
688         * @return
689         * @throws ScmException if any
690         */
691        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
692            throws ScmException;
693    
694        /**
695         * Updates the copy on the local machine with the changes in the repository
696         *
697         * @param repository   the source control system
698         * @param fileSet      location of your local copy
699         * @param tag          use the version defined by the tag
700         * @param runChangelog Run the changelog command after the update
701         * @return
702         * @throws ScmException if any
703         * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,
704         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, boolean)}
705         */
706        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog )
707            throws ScmException;
708    
709        /**
710         * Updates the copy on the local machine with the changes in the repository
711         *
712         * @param repository   the source control system
713         * @param fileSet      location of your local copy
714         * @param runChangelog Run the changelog command after the update
715         * @return
716         * @throws ScmException if any
717         */
718        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog )
719            throws ScmException;
720    
721        /**
722         * Updates the copy on the local machine with the changes in the repository
723         *
724         * @param repository   the source control system
725         * @param fileSet      location of your local copy
726         * @param version      use the version defined by the branch/tag/revision
727         * @param runChangelog Run the changelog command after the update
728         * @return
729         * @throws ScmException if any
730         */
731        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog )
732            throws ScmException;
733    
734        /**
735         * Updates the copy on the local machine with the changes in the repository
736         *
737         * @param repository  the source control system
738         * @param fileSet     location of your local copy
739         * @param tag         use the version defined by the tag
740         * @param datePattern the date pattern use in changelog output returned by scm tool
741         * @return
742         * @throws ScmException if any
743         * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,
744         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)}
745         */
746        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern )
747            throws ScmException;
748    
749        /**
750         * Updates the copy on the local machine with the changes in the repository
751         *
752         * @param repository  the source control system
753         * @param fileSet     location of your local copy
754         * @param version     use the version defined by the branch/tag/revision
755         * @param datePattern the date pattern use in changelog output returned by scm tool
756         * @return
757         * @throws ScmException if any
758         */
759        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern )
760            throws ScmException;
761    
762        /**
763         * Updates the copy on the local machine with the changes in the repository
764         *
765         * @param repository the source control system
766         * @param fileSet    location of your local copy
767         * @param tag        use the version defined by the tag
768         * @param lastUpdate
769         * @return
770         * @throws ScmException if any
771         * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,
772         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, java.util.Date)}
773         */
774        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate )
775            throws ScmException;
776    
777        /**
778         * Updates the copy on the local machine with the changes in the repository
779         *
780         * @param repository the source control system
781         * @param fileSet    location of your local copy
782         * @param version    use the version defined by the branch/tag/revision
783         * @param lastUpdate
784         * @return
785         * @throws ScmException if any
786         */
787        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate )
788            throws ScmException;
789    
790        /**
791         * Updates the copy on the local machine with the changes in the repository
792         *
793         * @param repository  the source control system
794         * @param fileSet     location of your local copy
795         * @param tag         use the version defined by the tag
796         * @param lastUpdate  Date of last update
797         * @param datePattern the date pattern use in changelog output returned by scm tool
798         * @return
799         * @throws ScmException if any
800         * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository,
801         *             org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, java.util.Date, String)}
802         */
803        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate,
804                                String datePattern )
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  Date of last update
814         * @param datePattern the date pattern use in changelog output returned by scm tool
815         * @return
816         * @throws ScmException if any
817         */
818        UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate,
819                                String datePattern )
820            throws ScmException;
821    
822        /**
823         * Make a file editable. This is used in source control systems where you look at read-only files
824         * and you need to make them not read-only anymore before you can edit them. This can also mean
825         * that no other user in the system can make the file not read-only anymore.
826         *
827         * @param repository the source control system
828         * @param fileSet    the files to make editable
829         * @return
830         * @throws ScmException if any
831         */
832        EditScmResult edit( ScmRepository repository, ScmFileSet fileSet )
833            throws ScmException;
834    
835        /**
836         * Make a file no longer editable. This is the conterpart of {@link #edit(
837         *org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)}.
838         * It makes the file read-only again.
839         *
840         * @param repository the source control system
841         * @param fileSet    the files to make uneditable
842         * @return
843         * @throws ScmException if any
844         */
845        UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
846            throws ScmException;
847    
848        /**
849         * List each element (files and directories) of <B>fileSet</B> as they exist in the repository.
850         *
851         * @param repository the source control system
852         * @param fileSet    the files to list
853         * @param recursive  descend recursively
854         * @param tag        use the version defined by the tag
855         * @return the list of files in the repository
856         * @deprecated you must use {@link ScmProvider#list(org.apache.maven.scm.repository.ScmRepository,
857         *             org.apache.maven.scm.ScmFileSet, boolean, org.apache.maven.scm.ScmVersion)}
858         */
859        ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag )
860            throws ScmException;
861    
862        /**
863         * List each element (files and directories) of <B>fileSet</B> as they exist in the repository.
864         *
865         * @param repository the source control system
866         * @param fileSet    the files to list
867         * @param recursive  descend recursively
868         * @param version    use the version defined by the branch/tag/revision
869         * @return the list of files in the repository
870         * @throws ScmException if any
871         */
872        ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version )
873            throws ScmException;
874    
875        /**
876         * Returns the blame of specified file
877         *
878         * @param repository the source control system
879         * @param fileSet    location of your local copy
880         * @param filename   file
881         * @return blame for specified file
882         * @throws ScmException
883         * @since 1.4
884         * @deprecated use blame with {@link BlameScmRequest} parameter
885         */
886        BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename )
887            throws ScmException;
888    
889        /**
890         *
891         * @param blameScmRequest
892         * @return blame for the file specified in the request
893         * @throws ScmException
894         * @since 1.8
895         */
896        BlameScmResult blame( BlameScmRequest blameScmRequest )
897            throws ScmException;
898    
899    
900        /**
901         * Create directory/directories in the repository.
902         *
903         * @param repository
904         * @param fileSet
905         * @param createInLocal
906         * @param message
907         * @return
908         * @throws ScmException
909         */
910        MkdirScmResult mkdir( ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal )
911            throws ScmException;
912    
913        /**
914         * @param repository the source control system
915         * @param fileSet    location of your local copy
916         * @param parameters some parameters (not use currently but for future use)
917         * @return if the scm implementation doesn't support "info" result will <code>null</code>
918         * @throws ScmException
919         * @since 1.5
920         */
921        InfoScmResult info( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
922            throws ScmException;
923    
924        /**
925         * @param repository the source control system
926         * @param fileSet    not use currently but for future use
927         * @param parameters some parameters (not use currently but for future use)
928         * @return if the scm implementation doesn't support "info" result will <code>null</code>
929         * @throws ScmException
930         * @since 1.6
931         */
932        RemoteInfoScmResult remoteInfo( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
933            throws ScmException;
934    }