1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
13 |
|
14 | var _toConsumableArray2 = require("@babel/runtime/helpers/interopRequireDefault")(require("@babel/runtime/helpers/toConsumableArray"));
|
15 |
|
16 | function execFile(cmd, args) {
|
17 | return new Promise(function (resolve, reject) {
|
18 | require("child_process").execFile(cmd, args, function (err) {
|
19 | if (err) {
|
20 | reject(err);
|
21 | } else {
|
22 | resolve();
|
23 | }
|
24 | });
|
25 | });
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | var SourceControlMercurial = {
|
33 | addRemove: function () {
|
34 | var _addRemove = _asyncToGenerator(function* (added, removed) {
|
35 |
|
36 |
|
37 | if (added.length > 0) {
|
38 | yield execFile('hg', ['add'].concat((0, _toConsumableArray2["default"])(added)));
|
39 | }
|
40 |
|
41 | if (removed.length > 0) {
|
42 | yield execFile('hg', ['forget'].concat((0, _toConsumableArray2["default"])(removed)));
|
43 | }
|
44 | });
|
45 |
|
46 | return function addRemove(_x, _x2) {
|
47 | return _addRemove.apply(this, arguments);
|
48 | };
|
49 | }()
|
50 | };
|
51 | module.exports = {
|
52 | SourceControlMercurial: SourceControlMercurial
|
53 | }; |
\ | No newline at end of file |