1 package org.apache.maven.scm.provider; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.apache.maven.scm.CommandParameters; 23 import org.apache.maven.scm.ScmBranch; 24 import org.apache.maven.scm.ScmBranchParameters; 25 import org.apache.maven.scm.ScmException; 26 import org.apache.maven.scm.ScmFileSet; 27 import org.apache.maven.scm.ScmTagParameters; 28 import org.apache.maven.scm.ScmVersion; 29 import org.apache.maven.scm.command.add.AddScmResult; 30 import org.apache.maven.scm.command.blame.BlameScmRequest; 31 import org.apache.maven.scm.command.blame.BlameScmResult; 32 import org.apache.maven.scm.command.branch.BranchScmResult; 33 import org.apache.maven.scm.command.changelog.ChangeLogScmRequest; 34 import org.apache.maven.scm.command.changelog.ChangeLogScmResult; 35 import org.apache.maven.scm.command.checkin.CheckInScmResult; 36 import org.apache.maven.scm.command.checkout.CheckOutScmResult; 37 import org.apache.maven.scm.command.diff.DiffScmResult; 38 import org.apache.maven.scm.command.edit.EditScmResult; 39 import org.apache.maven.scm.command.export.ExportScmResult; 40 import org.apache.maven.scm.command.info.InfoScmResult; 41 import org.apache.maven.scm.command.list.ListScmResult; 42 import org.apache.maven.scm.command.mkdir.MkdirScmResult; 43 import org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult; 44 import org.apache.maven.scm.command.remove.RemoveScmResult; 45 import org.apache.maven.scm.command.status.StatusScmResult; 46 import org.apache.maven.scm.command.tag.TagScmResult; 47 import org.apache.maven.scm.command.unedit.UnEditScmResult; 48 import org.apache.maven.scm.command.update.UpdateScmResult; 49 import org.apache.maven.scm.log.ScmLogger; 50 import org.apache.maven.scm.repository.ScmRepository; 51 import org.apache.maven.scm.repository.ScmRepositoryException; 52 import org.apache.maven.scm.repository.UnknownRepositoryStructure; 53 54 import java.io.File; 55 import java.util.Date; 56 import java.util.List; 57 58 /** 59 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> 60 * 61 */ 62 public interface ScmProvider 63 { 64 String ROLE = ScmProvider.class.getName(); 65 66 String getScmType(); 67 68 /** 69 * Add a logger listener. 70 * 71 * @param logger The logger 72 */ 73 void addListener( ScmLogger logger ); 74 75 boolean requiresEditMode(); 76 77 ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) 78 throws ScmRepositoryException; 79 80 ScmProviderRepository makeProviderScmRepository( File path ) 81 throws ScmRepositoryException, UnknownRepositoryStructure; 82 83 /** 84 * Validate the scm url. 85 * 86 * @param scmSpecificUrl The SCM url 87 * @param delimiter The delimiter used in the SCM url 88 * @return Returns a list of messages if the validation failed 89 */ 90 List<String> validateScmUrl( String scmSpecificUrl, char delimiter ); 91 92 /** 93 * Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'. 94 * 95 * @return the scm reserved file name 96 */ 97 String getScmSpecificFilename(); 98 99 /** 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()} 500 * location 501 * @param version get the version defined by the revision, branch or tag 502 * @param commandParameters parameters 503 * @return 504 * @throws ScmException if any 505 * @since 1.9.6 506 */ 507 CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion version , // 508 CommandParameters commandParameters ) 509 throws ScmException; 510 511 /** 512 * Create a diff between two branch/tag/revision. 513 * 514 * @param scmRepository the source control system 515 * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 516 * @param startRevision the start revision 517 * @param endRevision the end revision 518 * @return 519 * @throws ScmException if any 520 * @deprecated you must use {@link ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository, 521 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, org.apache.maven.scm.ScmVersion)} 522 */ 523 DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, String startRevision, String endRevision ) 524 throws ScmException; 525 526 /** 527 * Create a diff between two branch/tag/revision. 528 * 529 * @param scmRepository the source control system 530 * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 531 * @param startVersion the start branch/tag/revision 532 * @param endVersion the end branch/tag/revision 533 * @return 534 * @throws ScmException if any 535 */ 536 DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion startVersion, 537 ScmVersion endVersion ) 538 throws ScmException; 539 540 /** 541 * Create an exported copy of the repository on your local machine 542 * 543 * @param repository the source control system 544 * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 545 * @param tag get the version defined by the tag 546 * @return 547 * @throws ScmException if any 548 * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository, 549 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)} 550 */ 551 ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag ) 552 throws ScmException; 553 554 /** 555 * Create an exported copy of the repository on your local machine 556 * 557 * @param repository the source control system 558 * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 559 * @return 560 * @throws ScmException if any 561 */ 562 ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) 563 throws ScmException; 564 565 /** 566 * Create an exported copy of the repository on your local machine 567 * 568 * @param repository the source control system 569 * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 570 * @param version get the version defined by the branch/tag/revision 571 * @return 572 * @throws ScmException if any 573 */ 574 ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) 575 throws ScmException; 576 577 /** 578 * Create an exported copy of the repository on your local machine 579 * 580 * @param repository the source control system 581 * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 582 * @param tag get the version defined by the tag 583 * @param outputDirectory the directory where the export will be stored 584 * @return 585 * @throws ScmException if any 586 * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository, 587 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)} 588 */ 589 ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory ) 590 throws ScmException; 591 592 /** 593 * Create an exported copy of the repository on your local machine 594 * 595 * @param repository the source control system 596 * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location 597 * @param version get the version defined by the branch/tag/revision 598 * @param outputDirectory the directory where the export will be stored 599 * @return 600 * @throws ScmException if any 601 */ 602 ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) 603 throws ScmException; 604 605 /** 606 * Removes the given files from the source control system 607 * 608 * @param repository the source control system 609 * @param fileSet the files to be removed 610 * @param message 611 * @return 612 * @throws ScmException if any 613 */ 614 RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) 615 throws ScmException; 616 617 /** 618 * Returns the status of the files in the source control system. The state of each file can be one 619 * of the {@link org.apache.maven.scm.ScmFileStatus} flags. 620 * 621 * @param repository the source control system 622 * @param fileSet the files to know the status about. Implementations can also give the changes 623 * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. 624 * @return 625 * @throws ScmException if any 626 */ 627 StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) 628 throws ScmException; 629 630 /** 631 * Tag (or label in some systems) will tag the source file with a certain tag 632 * 633 * @param repository the source control system 634 * @param fileSet the files to tag. Implementations can also give the changes 635 * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. 636 * @param tagName the tag name to apply to the files 637 * @return 638 * @throws ScmException if any 639 * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)} 640 */ 641 TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) 642 throws ScmException; 643 644 /** 645 * Tag (or label in some systems) will tag the source file with a certain tag 646 * 647 * @param repository the source control system 648 * @param fileSet the files to tag. Implementations can also give the changes 649 * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. 650 * @param tagName the tag name to apply to the files 651 * @param message the commit message used for the tag creation 652 * @return 653 * @throws ScmException if any 654 * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)} 655 */ 656 TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) 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 scmTagParameters bean to pass some paramters for tagging {@link ScmTagParameters} 667 * @return 668 * @throws ScmException if any 669 * @since 1.2 670 */ 671 TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) 672 throws ScmException; 673 674 /** 675 * Updates the copy on the local machine with the changes in the repository 676 * 677 * @param repository the source control system 678 * @param fileSet location of your local copy 679 * @return 680 * @throws ScmException if any 681 */ 682 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) 683 throws ScmException; 684 685 /** 686 * Updates the copy on the local machine with the changes in the repository 687 * 688 * @param repository the source control system 689 * @param fileSet location of your local copy 690 * @param tag use the version defined by the tag 691 * @return 692 * @throws ScmException if any 693 * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, 694 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion)} 695 */ 696 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag ) 697 throws ScmException; 698 699 /** 700 * Updates the copy on the local machine with the changes in the repository 701 * 702 * @param repository the source control system 703 * @param fileSet location of your local copy 704 * @param version use the version defined by the branch/tag/revision 705 * @return 706 * @throws ScmException if any 707 */ 708 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) 709 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 tag use the version defined by the tag 717 * @param runChangelog Run the changelog command after the update 718 * @return 719 * @throws ScmException if any 720 * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, 721 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, boolean)} 722 */ 723 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog ) 724 throws ScmException; 725 726 /** 727 * Updates the copy on the local machine with the changes in the repository 728 * 729 * @param repository the source control system 730 * @param fileSet location of your local copy 731 * @param runChangelog Run the changelog command after the update 732 * @return 733 * @throws ScmException if any 734 */ 735 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) 736 throws ScmException; 737 738 /** 739 * Updates the copy on the local machine with the changes in the repository 740 * 741 * @param repository the source control system 742 * @param fileSet location of your local copy 743 * @param version use the version defined by the branch/tag/revision 744 * @param runChangelog Run the changelog command after the update 745 * @return 746 * @throws ScmException if any 747 */ 748 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) 749 throws ScmException; 750 751 /** 752 * Updates the copy on the local machine with the changes in the repository 753 * 754 * @param repository the source control system 755 * @param fileSet location of your local copy 756 * @param tag use the version defined by the tag 757 * @param datePattern the date pattern use in changelog output returned by scm tool 758 * @return 759 * @throws ScmException if any 760 * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, 761 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, String)} 762 */ 763 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern ) 764 throws ScmException; 765 766 /** 767 * Updates the copy on the local machine with the changes in the repository 768 * 769 * @param repository the source control system 770 * @param fileSet location of your local copy 771 * @param version use the version defined by the branch/tag/revision 772 * @param datePattern the date pattern use in changelog output returned by scm tool 773 * @return 774 * @throws ScmException if any 775 */ 776 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) 777 throws ScmException; 778 779 /** 780 * Updates the copy on the local machine with the changes in the repository 781 * 782 * @param repository the source control system 783 * @param fileSet location of your local copy 784 * @param tag use the version defined by the tag 785 * @param lastUpdate 786 * @return 787 * @throws ScmException if any 788 * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, 789 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, java.util.Date)} 790 */ 791 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate ) 792 throws ScmException; 793 794 /** 795 * Updates the copy on the local machine with the changes in the repository 796 * 797 * @param repository the source control system 798 * @param fileSet location of your local copy 799 * @param version use the version defined by the branch/tag/revision 800 * @param lastUpdate 801 * @return 802 * @throws ScmException if any 803 */ 804 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) 805 throws ScmException; 806 807 /** 808 * Updates the copy on the local machine with the changes in the repository 809 * 810 * @param repository the source control system 811 * @param fileSet location of your local copy 812 * @param tag use the version defined by the tag 813 * @param lastUpdate Date of last update 814 * @param datePattern the date pattern use in changelog output returned by scm tool 815 * @return 816 * @throws ScmException if any 817 * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, 818 * org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion, java.util.Date, String)} 819 */ 820 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate, 821 String datePattern ) 822 throws ScmException; 823 824 /** 825 * Updates the copy on the local machine with the changes in the repository 826 * 827 * @param repository the source control system 828 * @param fileSet location of your local copy 829 * @param version use the version defined by the branch/tag/revision 830 * @param lastUpdate Date of last update 831 * @param datePattern the date pattern use in changelog output returned by scm tool 832 * @return 833 * @throws ScmException if any 834 */ 835 UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, 836 String datePattern ) 837 throws ScmException; 838 839 /** 840 * Make a file editable. This is used in source control systems where you look at read-only files 841 * and you need to make them not read-only anymore before you can edit them. This can also mean 842 * that no other user in the system can make the file not read-only anymore. 843 * 844 * @param repository the source control system 845 * @param fileSet the files to make editable 846 * @return 847 * @throws ScmException if any 848 */ 849 EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) 850 throws ScmException; 851 852 /** 853 * Make a file no longer editable. This is the conterpart of {@link #edit( 854 *org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)}. 855 * It makes the file read-only again. 856 * 857 * @param repository the source control system 858 * @param fileSet the files to make uneditable 859 * @return 860 * @throws ScmException if any 861 */ 862 UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) 863 throws ScmException; 864 865 /** 866 * List each element (files and directories) of <B>fileSet</B> as they exist in the repository. 867 * 868 * @param repository the source control system 869 * @param fileSet the files to list 870 * @param recursive descend recursively 871 * @param tag use the version defined by the tag 872 * @return the list of files in the repository 873 * @deprecated you must use {@link ScmProvider#list(org.apache.maven.scm.repository.ScmRepository, 874 * org.apache.maven.scm.ScmFileSet, boolean, org.apache.maven.scm.ScmVersion)} 875 */ 876 ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag ) 877 throws ScmException; 878 879 /** 880 * List each element (files and directories) of <B>fileSet</B> as they exist in the repository. 881 * 882 * @param repository the source control system 883 * @param fileSet the files to list 884 * @param recursive descend recursively 885 * @param version use the version defined by the branch/tag/revision 886 * @return the list of files in the repository 887 * @throws ScmException if any 888 */ 889 ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) 890 throws ScmException; 891 892 /** 893 * Returns the blame of specified file 894 * 895 * @param repository the source control system 896 * @param fileSet location of your local copy 897 * @param filename file 898 * @return blame for specified file 899 * @throws ScmException 900 * @since 1.4 901 * @deprecated use blame with {@link BlameScmRequest} parameter 902 */ 903 BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename ) 904 throws ScmException; 905 906 /** 907 * 908 * @param blameScmRequest 909 * @return blame for the file specified in the request 910 * @throws ScmException 911 * @since 1.8 912 */ 913 BlameScmResult blame( BlameScmRequest blameScmRequest ) 914 throws ScmException; 915 916 917 /** 918 * Create directory/directories in the repository. 919 * 920 * @param repository 921 * @param fileSet 922 * @param createInLocal 923 * @param message 924 * @return 925 * @throws ScmException 926 */ 927 MkdirScmResult mkdir( ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal ) 928 throws ScmException; 929 930 /** 931 * @param repository the source control system 932 * @param fileSet location of your local copy 933 * @param parameters some parameters (not use currently but for future use) 934 * @return if the scm implementation doesn't support "info" result will <code>null</code> 935 * @throws ScmException 936 * @since 1.5 937 */ 938 InfoScmResult info( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) 939 throws ScmException; 940 941 /** 942 * @param repository the source control system 943 * @param fileSet not use currently but for future use 944 * @param parameters some parameters (not use currently but for future use) 945 * @return if the scm implementation doesn't support "info" result will <code>null</code> 946 * @throws ScmException 947 * @since 1.6 948 */ 949 RemoteInfoScmResult remoteInfo( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) 950 throws ScmException; 951 }