|
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 and pk-vcs-api projects as maven dependencies 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 |
| - compile 'com.github.ProjectKaiser:pk-vcs-api:master-SNAPSHOT' |
39 |
| - } |
40 |
| - ``` |
41 |
| -- 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) |
42 |
| -```java |
43 |
| - public static final String WORKSPACE_DIR = System.getProperty("java.io.tmpdir") + "git-workspaces"; |
44 |
| - ... |
45 |
| - IVCSWorkspace workspace = new VCSWorkspace(WORKSPACE_DIR); |
46 |
| - ... |
47 |
| -``` |
48 |
| -- 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 |
49 |
| -```java |
50 |
| - String repoUrl = "https://github.com/ProjectKaiser/pk-vcs-api"; |
51 |
| - IVCSRepositoryWorkspace repoWorkspace = workspace.getVCSRepositoryWorkspace(repoUrl); |
52 |
| -``` |
53 |
| -- Create `SVNVCS` instance providing Repository Workspace, username and password for Repository |
54 |
| -```java |
55 |
| - IVCS vcs = new SVNVCS(repoWorkspace, username, pass); |
56 |
| -``` |
57 |
| -- Use methods of `IVCS` interface. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details |
58 |
| -- Use `vcs.setProxy()` and `vcs.setCredentials()` if necessary |
59 |
| - |
60 |
| -# Implementation details |
61 |
| -- [SVNKit](https://svnkit.com/) is used for manage SVN repositories |
62 |
| -- LWC is obtained automatically when necessary |
63 |
| - |
64 |
| -# Functional testing |
65 |
| -- 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 |
66 |
| - |
67 |
| -# Limitations |
68 |
| -- 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.: |
69 |
| - - Assume we have following directory structure: |
70 |
| - - Branches/Br1/Folder/file.txt |
71 |
| - - Branches/Br2/Folder/file.txt |
72 |
| - - Trunk/Folder/file.txt |
73 |
| - - Tags/Tag1/ |
74 |
| - - Then `SVNVCS.getBranches()` method will return [Br1, Br2, Trunk] |
| 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 and pk-vcs-api projects as maven dependencies 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 | + compile 'com.github.ProjectKaiser:pk-vcs-api:master-SNAPSHOT' |
| 39 | + } |
| 40 | + ``` |
| 41 | +- 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) |
| 42 | +```java |
| 43 | + public static final String WORKSPACE_DIR = System.getProperty("java.io.tmpdir") + "git-workspaces"; |
| 44 | + ... |
| 45 | + IVCSWorkspace workspace = new VCSWorkspace(WORKSPACE_DIR); |
| 46 | + ... |
| 47 | +``` |
| 48 | +- 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 |
| 49 | +```java |
| 50 | + String repoUrl = "https://github.com/ProjectKaiser/pk-vcs-api"; |
| 51 | + IVCSRepositoryWorkspace repoWorkspace = workspace.getVCSRepositoryWorkspace(repoUrl); |
| 52 | +``` |
| 53 | +- Create `SVNVCS` instance providing Repository Workspace, username and password for Repository |
| 54 | +```java |
| 55 | + IVCS vcs = new SVNVCS(repoWorkspace, username, pass); |
| 56 | +``` |
| 57 | +- Use methods of `IVCS` interface. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details |
| 58 | +- Use `vcs.setProxy()` and `vcs.setCredentials()` if necessary |
| 59 | + |
| 60 | +# Implementation details |
| 61 | +- [SVNKit](https://svnkit.com/) is used for manage SVN repositories |
| 62 | +- LWC is obtained automatically when necessary |
| 63 | + |
| 64 | +# Functional testing |
| 65 | +- 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 |
| 66 | +- Or run `gradle test` |
| 67 | + |
| 68 | +# Limitations |
| 69 | +- 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.: |
| 70 | + - Assume we have following directory structure: |
| 71 | + - Branches/Br1/Folder/file.txt |
| 72 | + - Branches/Br2/Folder/file.txt |
| 73 | + - Trunk/Folder/file.txt |
| 74 | + - Tags/Tag1/ |
| 75 | + - Then `SVNVCS.getBranches()` method will return [Br1, Br2, Trunk] |
0 commit comments