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