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