You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scm4j-vcs-api is set of base classes and interfaces to build VCS support (Git, SVN, etc) libraries which exposes basic vcs-related operations: merge, branch create etc.
6
7
scm4j-vcs-api provides:
7
8
- A simple interface to implement basic VCS-related operations
8
-
- Set of functional tests which are common to each VCS implementation. Functional tests for a certain VCS implementation are done by implementing few abstract methods of base test class. Implemented in [scm4j-vcs-test](https://github.com/scm4j/scm4j-vcs-test)
9
+
- Set of functional tests wchich are common to each VCS implementation. Functional tests for a certain VCS implementation are done by implementing few abstract methods of base test class. Implemented in [scm4j-vcs-test](https://github.com/scm4j/scm4j-vcs-test)
9
10
- Working copy management for operations which must be executed on local file system
10
11
11
12
# Terms
@@ -70,16 +71,15 @@ Note: null passed as a branch name is considered as Master Branch. Any non-null
70
71
- Creates the file and its parent folders if doesn't exists
- Returns list of `VCSDiffEntry` showing what was made within branch `srcBranchName` relative to branch `destBranchName`
73
-
- Note: result is a commit which would be made on merging the branch `srcBranchName` into `destBranchName`
74
+
- Note: result could be considered as a commit which would be made on merging the branch `srcBranchName` into `destBranchName`
74
75
-`Set<String> getBranches()`
75
76
- Returns list of names of all branches. Branches here are considered as user-created branches and Master Branch. I.e. any branch for Git, "Trunk" and any branch within "Branches" branch (not "Tags" branches) for SVN etc
- Removes the file located by `filePath` within branch `branchName`. Operation is executed as separate commit with `commitMessage` message attached. Note: filePath = "folder\file.txt" -> file.txt is removed, folder is kept
82
-
- Returns commit id (hash, revision number etc)
82
+
- Removes the file with path `filePath` within branch `branchName`. Operation is executed as separate commit with `commitMessage` message attached. Note: filePath = "folder\file.txt" -> file.txt is removed, folder is kept
- Returns ordered list of all commits located between commits specified by `firstCommitId` and `untilCommitId` inclusively within branch `branchName`
85
85
- If `firstCommitId` is null then all commits until commit specified by `untilCommitId` inclusively are fetched
@@ -88,9 +88,9 @@ Note: null passed as a branch name is considered as Master Branch. Any non-null
88
88
- Returns ordered list of `limit` commits (0 is unlimited) starting from commit specified by `firstCommitId` in direction specified by `direction`
89
89
- If `firstCommitId` is null then commits are starting at branch `branchName` first commit (for ASC direction) or at head of branch (for DESC direction)
90
90
-`VCSCommit getHeadCommit(String branchName)`
91
-
- Returns `VCSCommit` instance which points to the head (last) commit of the branch `branchName`
91
+
- Returns `VCSCommit` instance pointing to the head (last) commit of the branch `branchName`
- Returns true if file with path `filePath`exist in repository in branch `branchName`, false otherwise
93
+
- Returns true if the file with path `filePath`exists in repository in branch `branchName`, false otherwise
94
94
95
95
# Using Locked Working Copy
96
96
Let's assume we developing a multiuser server which has ability to merge branches of user's repositories. So few users could request to merge theirs branches of different repositories simultaneously. For example, Git merge operation consists of few underlying operations (check in\out, merge itself, push) which must be executed on a local file system in a certain folder. So we have following requirements:
- Throw exceptions from scm4j.vcs.api.exceptions package. Abstract Test checks throwning of these exceptions.
194
194
- Implement functional tests
195
195
- Create VCSAbstractTest subclass within test package, implement all abstract methods
196
-
- Normally test class should not include any test, just @After\@Before methods. All necessary functional testing is implemented within VCSAbstractTest
196
+
- Normally test class should not include any test, just @After and @Before methods. All necessary functional testing is implemented within VCSAbstractTest
197
197
- See [scm4j-vcs-test](https://github.com/scm4j/scm4j-vcs-test) for details
198
198
- Example of gradle usage to export IVCS implementation, its sources and javadoc as separate single JARs:
0 commit comments