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