Skip to content

Commit b7efbe6

Browse files
committed
Added async startCopyFrom method, version bump
1 parent 3498854 commit b7efbe6

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

js/gitana/repository/Repository.js

+26
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,32 @@
597597
return this.chainPost(this, uriFunction, params, config)
598598
},
599599

600+
/**
601+
* Copies nodes from the source branch to the target branch asynchronously.
602+
*
603+
* @param {String} sourceBranchId
604+
* @param {String} targetBranchId
605+
* @param {Object} config
606+
* @param [Function] callback
607+
*/
608+
startCopyFrom: function(sourceBranchId, targetBranchId, config, callback)
609+
{
610+
var params = {
611+
id: sourceBranchId
612+
};
613+
614+
var uriFunction = function()
615+
{
616+
return "/repositories/" + this.getId() + "/branches/" + targetBranchId + "/copyfrom/start";
617+
};
618+
619+
return this.chainPostResponse(this, uriFunction, params, config).then(function(response) {
620+
621+
var jobId = response._doc;
622+
623+
callback(jobId);
624+
});
625+
},
600626

601627

602628
//////////////////////////////////////////////////////////////////////////////////////////////////////////

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitanajs",
3-
"version": "1.0.301",
3+
"version": "1.0.302",
44
"repository": {
55
"type": "git",
66
"url": "git://github.com/gitana/gitana-javascript-driver.git"

0 commit comments

Comments
 (0)