scm run -> _run

This commit is contained in:
oleg 2016-02-27 23:47:36 +03:00
parent a7840fc219
commit f721de039d
3 changed files with 12 additions and 12 deletions

View File

@ -33,7 +33,7 @@ exports.Scm = Scm;
inherits(Scm, EventEmitter); inherits(Scm, EventEmitter);
Scm.prototype.run = function(params, callback) { Scm.prototype._run = function(params, callback) {
if (this.cwd) { if (this.cwd) {
params.options = params.options || {}; params.options = params.options || {};
params.options.cwd = this.cwd; params.options.cwd = this.cwd;

View File

@ -60,14 +60,14 @@ Scm.prototype.clone = function(dst, rev, callback) {
function() { function() {
// git can't clearly clone specified rev but can clone branch // git can't clearly clone specified rev but can clone branch
// possible solution to change clone params to (dst, branch, callback) // possible solution to change clone params to (dst, branch, callback)
self.run({ self._run({
cmd: 'git', cmd: 'git',
args: ['clone', '--recursive', self.repository, dst] args: ['clone', '--recursive', self.repository, dst]
}, this.slot()); }, this.slot());
self.cwd = dst; self.cwd = dst;
}, },
function() { function() {
self.run({cmd: 'git', args: ['checkout', '-f', rev]}, this.slot()); self._run({cmd: 'git', args: ['checkout', '-f', rev]}, this.slot());
}, },
callback callback
); );
@ -82,7 +82,7 @@ Scm.prototype.pull = function(rev, callback) {
}, },
function(err, currentRev) { function(err, currentRev) {
this.pass(currentRev); this.pass(currentRev);
self.run({cmd: 'git', args: ['pull']}, this.slot()); self._run({cmd: 'git', args: ['pull']}, this.slot());
}, },
function(err, currentRev) { function(err, currentRev) {
self.update(currentRev.id, this.slot()); self.update(currentRev.id, this.slot());
@ -104,7 +104,7 @@ Scm.prototype.getRev = function(rev, callback) {
var self = this; var self = this;
Steppy( Steppy(
function() { function() {
self.run({cmd: 'git', args: [ self._run({cmd: 'git', args: [
'show', rev, 'show', rev,
'--pretty=' + self._revTemplate '--pretty=' + self._revTemplate
]}, this.slot()); ]}, this.slot());
@ -146,7 +146,7 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
function(err, currentRev) { function(err, currentRev) {
this.pass(currentRev); this.pass(currentRev);
self.run({cmd: 'git', args: [ self._run({cmd: 'git', args: [
'log', rev1 ? rev1 + '..' + rev2 : rev2, 'log', rev1 ? rev1 + '..' + rev2 : rev2,
'--pretty=' + self._revTemplate + self._linesSeparator '--pretty=' + self._revTemplate + self._linesSeparator
]}, this.slot()); ]}, this.slot());
@ -172,5 +172,5 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
}; };
Scm.prototype.update = function(rev, callback) { Scm.prototype.update = function(rev, callback) {
this.run({cmd: 'git', args: ['checkout', '-f', rev]}, callback); this._run({cmd: 'git', args: ['checkout', '-f', rev]}, callback);
}; };

View File

@ -55,7 +55,7 @@ Scm.prototype.clone = function(dst, rev, callback) {
var self = this; var self = this;
Steppy( Steppy(
function() { function() {
self.run({ self._run({
cmd: 'hg', cmd: 'hg',
args: ['clone', '--rev', rev, self.repository, dst] args: ['clone', '--rev', rev, self.repository, dst]
}, this.slot()); }, this.slot());
@ -66,14 +66,14 @@ Scm.prototype.clone = function(dst, rev, callback) {
}; };
Scm.prototype.pull = function(rev, callback) { Scm.prototype.pull = function(rev, callback) {
this.run({cmd: 'hg', args: ['pull', '--rev', rev]}, callback); this._run({cmd: 'hg', args: ['pull', '--rev', rev]}, callback);
}; };
Scm.prototype.getCurrent = function(callback) { Scm.prototype.getCurrent = function(callback) {
var self = this; var self = this;
Steppy( Steppy(
function() { function() {
self.run({cmd: 'hg', args: [ self._run({cmd: 'hg', args: [
'parent', '--template', self._revTemplate 'parent', '--template', self._revTemplate
]}, this.slot()); ]}, this.slot());
}, },
@ -88,7 +88,7 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
var self = this; var self = this;
Steppy( Steppy(
function() { function() {
self.run({cmd: 'hg', args: [ self._run({cmd: 'hg', args: [
'log', '--rev', rev2 + ':' + rev1, 'log', '--rev', rev2 + ':' + rev1,
'--template', self._revTemplate + self._linesSeparator '--template', self._revTemplate + self._linesSeparator
]}, this.slot()); ]}, this.slot());
@ -111,5 +111,5 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
}; };
Scm.prototype.update = function(rev, callback) { Scm.prototype.update = function(rev, callback) {
this.run({cmd: 'hg', args: ['up', '-C', rev]}, callback); this._run({cmd: 'hg', args: ['up', '-C', rev]}, callback);
}; };