diff options
author | manisha <manisha@wso2.com> | 2014-03-21 14:27:02 +0530 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-05-08 09:00:11 -0400 |
commit | 03d5ee0bcc4b9d7b6814d7212d19d1126638810d (patch) | |
tree | 87abd3bc8240cd1b5754b5ef6d34fa451127878b /src/main/java/com/gitblit/utils/RpcUtils.java | |
parent | 0ee8041f980dab7fee723a326fa2a2f5d1fea054 (diff) | |
download | gitblit-03d5ee0bcc4b9d7b6814d7212d19d1126638810d.tar.gz gitblit-03d5ee0bcc4b9d7b6814d7212d19d1126638810d.zip |
Implement FORK RPC request type
Diffstat (limited to 'src/main/java/com/gitblit/utils/RpcUtils.java')
-rw-r--r-- | src/main/java/com/gitblit/utils/RpcUtils.java | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/main/java/com/gitblit/utils/RpcUtils.java b/src/main/java/com/gitblit/utils/RpcUtils.java index 5e577fb6..904461c8 100644 --- a/src/main/java/com/gitblit/utils/RpcUtils.java +++ b/src/main/java/com/gitblit/utils/RpcUtils.java @@ -25,16 +25,7 @@ import java.util.Map; import com.gitblit.Constants;
import com.gitblit.Constants.RpcRequest;
import com.gitblit.GitBlitException.UnknownRequestException;
-import com.gitblit.models.FederationModel;
-import com.gitblit.models.FederationProposal;
-import com.gitblit.models.FederationSet;
-import com.gitblit.models.FeedModel;
-import com.gitblit.models.RegistrantAccessPermission;
-import com.gitblit.models.RepositoryModel;
-import com.gitblit.models.ServerSettings;
-import com.gitblit.models.ServerStatus;
-import com.gitblit.models.TeamModel;
-import com.gitblit.models.UserModel;
+import com.gitblit.models.*;
import com.google.gson.reflect.TypeToken;
/**
@@ -203,7 +194,25 @@ public class RpcUtils { }
- /**
+ /**
+ * Create a fork of an already existing repo
+ *
+ * @param repository
+ * @param user
+
+ * @return true if the action succeeded
+ * @throws IOException
+ */
+ public static boolean forkRpository(RepositoryModel repository, UserModel user, String serverUrl,
+ String account, char[] password) throws IOException {
+ UserRepositoryCompositeModel userRepositoryCompositeModel = new UserRepositoryCompositeModel();
+ userRepositoryCompositeModel.setRepositoryModel(repository);
+ userRepositoryCompositeModel.setUserModel(user);
+ return doAction(RpcRequest.FORK_REPOSITORY, null, userRepositoryCompositeModel, serverUrl, account, password);
+ }
+
+
+ /**
* Send a revised version of the repository model to the Gitblit server.
*
* @param repository
|