|
1 | | -[](https://jitpack.io/#ProjectKaiser/pk-vcs-svn) |
2 | | - |
3 | | -# Overview |
4 | | -Pk-vcs-svn is lightweight library for execute basic SVN VCS operations (merge, branch create etc). It uses [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) exposing IVCS implementation for SVN repositories and [SVNKit](https://svnkit.com/) as framework to work with SVN repositories. |
5 | | -Features: |
6 | | -- Branch create and remove |
7 | | -- Branch merge returning result(success or list of conflicted files) |
8 | | -- Commit messages list |
9 | | -- Summarized diff between branches |
10 | | -- Branches list |
11 | | -- File content getting and setting |
12 | | -- File create and remove |
13 | | - |
14 | | -# Terms |
15 | | -- Workspace Home |
16 | | - - Home folder of all folders used by vcs-related operations. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details |
17 | | -- Repository Workspace |
18 | | - - Folder for LWC folders related to Repository of one type. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details |
19 | | -- Locked Working Copy, LWC |
20 | | - - Folder where vcs-related operations are executed. Provides thread- and process-safe repository of working folders. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details |
21 | | -- Test Repository |
22 | | - - A SVN repository used for functional testing |
23 | | - - Local file system is used, no dedicated server |
24 | | - - Creates new before and deletes after each test |
25 | | - - Named randomly (uuid is used) |
26 | | - |
27 | | -# Using pk-vcs-svn |
28 | | -- Add github-hosted pk-vcs-svn project as maven dependency using [jitpack.io](https://jitpack.io/). As an example, add following to gradle.build file: |
29 | | - ```gradle |
30 | | - allprojects { |
31 | | - repositories { |
32 | | - maven { url "https://jitpack.io" } |
33 | | - } |
34 | | - } |
35 | | - |
36 | | - dependencies { |
37 | | - compile 'com.github.ProjectKaiser:pk-vcs-svn:master-SNAPSHOT' |
38 | | - } |
39 | | - ``` |
40 | | -- Create Workspace Home instance providing path to any folder as Workspace Home folder path. This folder will contain repositories folders (if different vcs or repositories are used) |
41 | | -```java |
42 | | - public static final String WORKSPACE_DIR = System.getProperty("java.io.tmpdir") + "git-workspaces"; |
43 | | - ... |
44 | | - IVCSWorkspace workspace = new VCSWorkspace(WORKSPACE_DIR); |
45 | | - ... |
46 | | -``` |
47 | | -- Obtain Repository Workspace from Workspace Home providing a certain Repository's url. The obtained Repository Workspace will represent a folder within Workspace Home dir which will contain all Working Copies relating to the provided VCS Repository |
48 | | -```java |
49 | | - String repoUrl = "https://github.com/ProjectKaiser/pk-vcs-api"; |
50 | | - IVCSRepositoryWorkspace repoWorkspace = workspace.getVCSRepositoryWorkspace(repoUrl); |
51 | | -``` |
52 | | -- Create `SVNVCS` instance providing Repository Workspace, username and password for Repository |
53 | | -```java |
54 | | - IVCS vcs = new SVNVCS(repoWorkspace, username, pass); |
55 | | -``` |
56 | | -- Use methods of `IVCS` interface. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details |
57 | | -- Use `vcs.setProxy()` and `vcs.setCredentials()` if necessary |
58 | | - |
59 | | -# Implementation details |
60 | | -- [SVNKit](https://svnkit.com/) is used for manage SVN repositories |
61 | | -- LWC is obtained automatically when necessary |
62 | | - |
63 | | -# Functional testing |
64 | | -- To execute tests just run SVNVCSTest class as JUnit test. Tests from VCSAbstractTest class will be executed. See [pk-vcs-test](https://github.com/ProjectKaiser/pk-vcs-test) for details |
65 | | - |
66 | | -# Limitations |
67 | | -- According to IVCS description `IVCS.getBranches()` should return list of user-created branches. But a branch and a dir are the same for SVN. So `SVNVCS.getBranches()` returns set of first level folders of "Branches/" branch and "Trunk" branch. I.e.: |
68 | | - - Assume we have following directory structure: |
69 | | - - Branches/Br1/Folder/file.txt |
70 | | - - Branches/Br2/Folder/file.txt |
71 | | - - Trunk/Folder/file.txt |
72 | | - - Tags/Tag1/ |
73 | | - - Then `SVNVCS.getBranches()` method will return [Br1, Br2, Trunk] |
| 1 | +[](https://jitpack.io/#scm4j/scm4j-vcs-svn) |
| 2 | + |
| 3 | +# Overview |
| 4 | +scm4j-vcs-svn is lightweight library for execute basic SVN VCS operations (merge, branch create etc). It uses [scm4j-vcs-api](https://github.com/scm4j/scm4j-vcs-api) exposing IVCS implementation for SVN repositories and [SVNKit](https://svnkit.com/) as framework to work with SVN repositories. |
| 5 | +Features: |
| 6 | +- Branch create and remove |
| 7 | +- Branch merge returning result(success or list of conflicted files) |
| 8 | +- Commit messages list |
| 9 | +- Summarized diff between branches |
| 10 | +- Branches list |
| 11 | +- File content getting and setting |
| 12 | +- File create and remove |
| 13 | + |
| 14 | +# Terms |
| 15 | +- Workspace Home |
| 16 | + - Local home folder of all folders used by vcs-related operations. See [scm4j-vcs-api](https://github.com/scm4j/scm4j-vcs-api) for details |
| 17 | +- Repository Workspace |
| 18 | + - Local folder for LWC folders related to Repository of one type. See [scm4j-vcs-api](https://github.com/scm4j/scm4j-vcs-api) for details |
| 19 | +- Locked Working Copy, LWC |
| 20 | + - Local folder where vcs-related operations are executed. Provides thread- and process-safe repository of working folders. See [scm4j-vcs-api](https://github.com/scm4j/scm4j-vcs-api) for details |
| 21 | +- Test Repository |
| 22 | + - A local file-based SVN repository used for functional testing |
| 23 | + - Creates new before and deletes after each test automatically |
| 24 | + - Named randomly (uuid is used) |
| 25 | + |
| 26 | +# Using scm4j-vcs-svn |
| 27 | +- Add github-hosted scm4j-vcs-svn project as maven dependency using [jitpack.io](https://jitpack.io/). As an example, add following to gradle.build file: |
| 28 | + ```gradle |
| 29 | + allprojects { |
| 30 | + repositories { |
| 31 | + maven { url "https://jitpack.io" } |
| 32 | + } |
| 33 | + } |
| 34 | + |
| 35 | + dependencies { |
| 36 | + // versioning: master-SNAPSHOT (lastest build, unstable), + (lastest release, stable) or certain version (e.g. 1.1) |
| 37 | + compile 'com.github.scm4j:scm4j-vcs-svn:+' |
| 38 | + } |
| 39 | + ``` |
| 40 | + Or download release jars from https://github.com/scm4j/scm4j-vcs-svn/releases |
| 41 | +- Code snippet |
| 42 | +```java |
| 43 | + public static final String WORKSPACE_DIR = System.getProperty("java.io.tmpdir") + "svn-workspaces"; |
| 44 | + IVCSWorkspace workspace = new VCSWorkspace(WORKSPACE_DIR); |
| 45 | + String repoUrl = "https://github.com/MyUser/MyRepo"; |
| 46 | + IVCSRepositoryWorkspace repoWorkspace = workspace.getVCSRepositoryWorkspace(repoUrl); |
| 47 | + IVCS vcs = new SVNVCS(repoWorkspace, "username", "pass"); |
| 48 | +``` |
| 49 | +- Use methods of `IVCS` interface. See [scm4j-vcs-api](https://github.com/scm4j/scm4j-vcs-api) for details |
| 50 | +- Use `vcs.setProxy()` and `vcs.setCredentials()` if necessary |
| 51 | + |
| 52 | +# Implementation details |
| 53 | +- [SVNKit](https://svnkit.com/) is used for manage SVN repositories |
| 54 | +- LWC is obtained automatically when necessary |
| 55 | + |
| 56 | +# Functional testing |
| 57 | +- To execute tests just run SVNVCSTest class as JUnit test. Tests from VCSAbstractTest class will be executed. See [scm4j-vcs-test](https://github.com/scm4j/scm4j-vcs-test) for details |
| 58 | +- Or run `gradle test` |
| 59 | + |
| 60 | +# Limitations |
| 61 | +- According to IVCS description `IVCS.getBranches()` should return list of user-created branches. But a branch and a dir are the same for SVN. So `SVNVCS.getBranches()` returns set of first level folders of "Branches/" branch and "Trunk" branch. I.e.: |
| 62 | + - Assume we have following directory structure: |
| 63 | + - Branches/Br1/Folder/file.txt |
| 64 | + - Branches/Br2/Folder/file.txt |
| 65 | + - Trunk/Folder/file.txt |
| 66 | + - Tags/Tag1/ |
| 67 | + - Then `SVNVCS.getBranches()` method will return [Br1, Br2, Trunk] |
0 commit comments