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