add an hg commands module

This commit is contained in:
Siddharth Agarwal 2013-07-31 02:17:27 -07:00
parent 40ed5f6c9b
commit e4c0b4786c
4 changed files with 73 additions and 54 deletions

View file

@ -9872,12 +9872,13 @@ var intl = require('../intl');
var Errors = require('../util/errors'); var Errors = require('../util/errors');
var GitCommands = require('../git/commands'); var GitCommands = require('../git/commands');
var MercurialCommands = require('../mercurial/commands');
var CommandProcessError = Errors.CommandProcessError; var CommandProcessError = Errors.CommandProcessError;
var CommandResult = Errors.CommandResult; var CommandResult = Errors.CommandResult;
var commandConfigs = { var commandConfigs = {
'git': GitCommands.gitCommandConfig, 'git': GitCommands.gitCommandConfig,
'hg': GitCommands.hgCommandConfig 'hg': MercurialCommands.hgCommandConfig
}; };
var commands = { var commands = {
@ -10047,22 +10048,7 @@ var GitError = Errors.GitError;
var Warning = Errors.Warning; var Warning = Errors.Warning;
var CommandResult = Errors.CommandResult; var CommandResult = Errors.CommandResult;
var gitCommandConfig, hgCommandConfig; var gitCommandConfig = {
hgCommandConfig = {
commit: {
regex: /^hg +commit($|\s)/,
options: [
'--amend',
'-m'
],
execute: function(engine, command) {
return gitCommandConfig.commit.execute(engine, command);
}
}
};
gitCommandConfig = {
commit: { commit: {
sc: /^(gc|git ci)($|\s)/, sc: /^(gc|git ci)($|\s)/,
regex: /^git +commit($|\s)/, regex: /^git +commit($|\s)/,
@ -10530,10 +10516,31 @@ var instantCommands = [
]; ];
exports.gitCommandConfig = gitCommandConfig; exports.gitCommandConfig = gitCommandConfig;
exports.hgCommandConfig = hgCommandConfig;
exports.instantCommands = instantCommands; exports.instantCommands = instantCommands;
});
require.define("/src/js/mercurial/commands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
var intl = require('../intl');
var GitCommands = require('../git/commands');
var hgCommandConfig = {
commit: {
regex: /^hg +commit($|\s)/,
options: [
'--amend',
'-m'
],
execute: function(engine, command) {
return GitCommands.gitCommandConfig.commit.execute(engine, command);
}
}
};
exports.hgCommandConfig = hgCommandConfig;
}); });
require.define("/src/js/util/eventBaton.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); require.define("/src/js/util/eventBaton.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
@ -23343,12 +23350,13 @@ var intl = require('../intl');
var Errors = require('../util/errors'); var Errors = require('../util/errors');
var GitCommands = require('../git/commands'); var GitCommands = require('../git/commands');
var MercurialCommands = require('../mercurial/commands');
var CommandProcessError = Errors.CommandProcessError; var CommandProcessError = Errors.CommandProcessError;
var CommandResult = Errors.CommandResult; var CommandResult = Errors.CommandResult;
var commandConfigs = { var commandConfigs = {
'git': GitCommands.gitCommandConfig, 'git': GitCommands.gitCommandConfig,
'hg': GitCommands.hgCommandConfig 'hg': MercurialCommands.hgCommandConfig
}; };
var commands = { var commands = {
@ -23960,22 +23968,7 @@ var GitError = Errors.GitError;
var Warning = Errors.Warning; var Warning = Errors.Warning;
var CommandResult = Errors.CommandResult; var CommandResult = Errors.CommandResult;
var gitCommandConfig, hgCommandConfig; var gitCommandConfig = {
hgCommandConfig = {
commit: {
regex: /^hg +commit($|\s)/,
options: [
'--amend',
'-m'
],
execute: function(engine, command) {
return gitCommandConfig.commit.execute(engine, command);
}
}
};
gitCommandConfig = {
commit: { commit: {
sc: /^(gc|git ci)($|\s)/, sc: /^(gc|git ci)($|\s)/,
regex: /^git +commit($|\s)/, regex: /^git +commit($|\s)/,
@ -24443,7 +24436,6 @@ var instantCommands = [
]; ];
exports.gitCommandConfig = gitCommandConfig; exports.gitCommandConfig = gitCommandConfig;
exports.hgCommandConfig = hgCommandConfig;
exports.instantCommands = instantCommands; exports.instantCommands = instantCommands;
@ -29645,6 +29637,29 @@ exports.commandEntered = function(value) {
}); });
require("/src/js/log/index.js"); require("/src/js/log/index.js");
require.define("/src/js/mercurial/commands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
var intl = require('../intl');
var GitCommands = require('../git/commands');
var hgCommandConfig = {
commit: {
regex: /^hg +commit($|\s)/,
options: [
'--amend',
'-m'
],
execute: function(engine, command) {
return GitCommands.gitCommandConfig.commit.execute(engine, command);
}
}
};
exports.hgCommandConfig = hgCommandConfig;
});
require("/src/js/mercurial/commands.js");
require.define("/src/js/models/collections.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); require.define("/src/js/models/collections.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
var Q = require('q'); var Q = require('q');
// horrible hack to get localStorage Backbone plugin // horrible hack to get localStorage Backbone plugin

View file

@ -3,12 +3,13 @@ var intl = require('../intl');
var Errors = require('../util/errors'); var Errors = require('../util/errors');
var GitCommands = require('../git/commands'); var GitCommands = require('../git/commands');
var MercurialCommands = require('../mercurial/commands');
var CommandProcessError = Errors.CommandProcessError; var CommandProcessError = Errors.CommandProcessError;
var CommandResult = Errors.CommandResult; var CommandResult = Errors.CommandResult;
var commandConfigs = { var commandConfigs = {
'git': GitCommands.gitCommandConfig, 'git': GitCommands.gitCommandConfig,
'hg': GitCommands.hgCommandConfig 'hg': MercurialCommands.hgCommandConfig
}; };
var commands = { var commands = {

View file

@ -7,22 +7,7 @@ var GitError = Errors.GitError;
var Warning = Errors.Warning; var Warning = Errors.Warning;
var CommandResult = Errors.CommandResult; var CommandResult = Errors.CommandResult;
var gitCommandConfig, hgCommandConfig; var gitCommandConfig = {
hgCommandConfig = {
commit: {
regex: /^hg +commit($|\s)/,
options: [
'--amend',
'-m'
],
execute: function(engine, command) {
return gitCommandConfig.commit.execute(engine, command);
}
}
};
gitCommandConfig = {
commit: { commit: {
sc: /^(gc|git ci)($|\s)/, sc: /^(gc|git ci)($|\s)/,
regex: /^git +commit($|\s)/, regex: /^git +commit($|\s)/,
@ -490,6 +475,5 @@ var instantCommands = [
]; ];
exports.gitCommandConfig = gitCommandConfig; exports.gitCommandConfig = gitCommandConfig;
exports.hgCommandConfig = hgCommandConfig;
exports.instantCommands = instantCommands; exports.instantCommands = instantCommands;

View file

@ -0,0 +1,19 @@
var _ = require('underscore');
var intl = require('../intl');
var GitCommands = require('../git/commands');
var hgCommandConfig = {
commit: {
regex: /^hg +commit($|\s)/,
options: [
'--amend',
'-m'
],
execute: function(engine, command) {
return GitCommands.gitCommandConfig.commit.execute(engine, command);
}
}
};
exports.hgCommandConfig = hgCommandConfig;