From 9e487bfd01e0052ed1e8cc58c4b7e1fbdcb54d2d Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 11:45:23 -0400 Subject: [PATCH 01/12] Updating dependancies --- .codeclimate.yaml | 17 +++++++++++++++++ .travis.yml | 1 + LICENCE.md | 23 +++++++++++++++++++++++ README.md | 3 ++- package.json | 26 ++++++++++++-------------- src/Hg.js | 2 +- src/HgRepo.js | 2 +- 7 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 .codeclimate.yaml create mode 100644 LICENCE.md diff --git a/.codeclimate.yaml b/.codeclimate.yaml new file mode 100644 index 00000000..f7e53999 --- /dev/null +++ b/.codeclimate.yaml @@ -0,0 +1,17 @@ +engines: + eslint: + enabled: true + duplication: + enabled: true + config: + languages: + javascript: + mass_threshold: 65 + shellcheck: + enabled: true +checks: + method-count: + enabled: false +ratings: + paths: + - "**.js" \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index fd21c8e8..28650313 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ node_js: - "7.6" - "7" - "8" + - "9" before_install: - sudo apt-get update - sudo apt-get install python2.7 diff --git a/LICENCE.md b/LICENCE.md new file mode 100644 index 00000000..28dd83b0 --- /dev/null +++ b/LICENCE.md @@ -0,0 +1,23 @@ +The MIT License +=============== + +Copyright (c) + **2017 Justin Dalrymple** + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 71cb59a4..97073ff4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Coverage Status](https://coveralls.io/repos/github/jdalrymple/node-hg-plus/badge.svg?branch=master)](https://coveralls.io/github/jdalrymple/node-hg-plus?branch=master) [![Build Status](https://travis-ci.org/jdalrymple/node-hg-plus.svg?branch=master)](https://travis-ci.org/jdalrymple/node-hg-plus) [![Dependency Status](https://david-dm.org/jdalrymple/node-hg-plus/status.svg)](https://david-dm.org/jdalrymple/node-test#info=dependencies) [![devDependency Status](https://david-dm.org/jdalrymple/node-hg-plus/dev-status.svg)](https://david-dm.org/jdalrymple/node-test#info=devDependencies) +[![Coverage Status](https://coveralls.io/repos/github/jdalrymple/node-hg-plus/badge.svg?branch=master)](https://coveralls.io/github/jdalrymple/node-hg-plus?branch=master) [![Build Status](https://travis-ci.org/jdalrymple/node-hg-plus.svg?branch=master)](https://travis-ci.org/jdalrymple/node-hg-plus) [![Dependency Status](https://david-dm.org/jdalrymple/node-hg-plus/status.svg)](https://david-dm.org/jdalrymple/node-test#info=dependencies) [![devDependency Status](https://david-dm.org/jdalrymple/node-hg-plus/dev-status.svg)](https://david-dm.org/jdalrymple/node-test#info=devDependencies)[![Code Climate](https://codeclimate.com/github/jdalrymple/node-hg-plus/badges/gpa.svg)](https://codeclimate.com/github/jdalrymple/node-hg-plus)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + # node-hg-plus diff --git a/package.json b/package.json index c8dd8ec9..40ce7670 100644 --- a/package.json +++ b/package.json @@ -20,26 +20,24 @@ "coverall": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" }, "devDependencies": { - "babel-eslint": "^7.1.1", - "babel-preset-latest": "^6.16.0", - "coveralls": "^2.11.15", - "eslint": "^4.3.0", - "eslint-config-airbnb": "^15.1.0", - "eslint-plugin-import": "^2.7.0", - "eslint-plugin-jsx-a11y": "^5.1.1", - "eslint-plugin-react": "^7.1.0", - "nyc": "^11.0.3", - "tape": "^4.6.3" + "coveralls": "^3.0.0", + "eslint": "^4.19.1", + "eslint-config-airbnb": "^16.1.0", + "eslint-plugin-import": "^2.11.0", + "eslint-plugin-jsx-a11y": "^6.0.3", + "eslint-plugin-react": "^7.7.0", + "nyc": "^11.7.1", + "tape": "^4.9.0" }, "dependencies": { "blue-tape": "^1.0.0", "bluebird": "^3.5.1", "dir-compare": "^1.4.0", - "fs-extra": "^4.0.2", - "globby": "^6.1.0", + "fs-extra": "^5.0.0", + "globby": "^8.0.1", "is-there": "^4.4.3", "shortid": "^2.2.8", - "tempy": "^0.1.0", - "winston": "^2.4.0" + "tempy": "^0.2.1", + "winston": "^2.4.2" } } diff --git a/src/Hg.js b/src/Hg.js index b91b4317..72675693 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -117,7 +117,7 @@ async function cloneMultipleAndMerge(from, to, pythonPath) { } class Hg { - constructor({ path = 'python' } = { path: 'python' }) { + constructor({ path = 'python' } = {}) { this.pythonPath = path; } diff --git a/src/HgRepo.js b/src/HgRepo.js index 299ee391..4b78a692 100644 --- a/src/HgRepo.js +++ b/src/HgRepo.js @@ -153,6 +153,7 @@ class HgRepo { lines.forEach((line) => { if (line === '') return; + const name = line.match(/(^.+)\s=/)[0]; const cleanedName = name.replace('=', '').trim(); @@ -235,7 +236,6 @@ class HgRepo { if (clean) optionArgs.push(' -C'); if (revision) optionArgs.push(` -r ${revision}`); if (revision) optionArgs.push(` -r ${revision}`); - if (check) optionArgs.push(' -c'); if (tool) optionArgs.push(` -t ${tool}`); From 263758608a8225f72897e04e619e2c8667cc489f Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 12:51:08 -0400 Subject: [PATCH 02/12] Add some error messages to tests --- tests/Hg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Hg.js b/tests/Hg.js index 1c92b1cf..a308fbac 100644 --- a/tests/Hg.js +++ b/tests/Hg.js @@ -99,8 +99,8 @@ Test('Cloning multiple live Hg repositories into one.', async (assert) => { DirectoryCompare.compare(Path.join(testDirectory, 'whoosh'), Path.join(outputDirectory, 'whoosh'), exclude), DirectoryCompare.compare(Path.join(testDirectory, 'hg-git'), Path.join(outputDirectory, 'hg-git'), exclude), ]).spread((compare1, compare2) => { - assert.true(compare1.same); - assert.true(compare2.same); + assert.true(compare1.same, 'First repo didnt match'); + assert.true(compare2.same, 'Second repo did not match'); }); }); From 43641f657ca7fce80398c05f8a96b0b57f1b5e8f Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 13:00:04 -0400 Subject: [PATCH 03/12] More logs when debugging tests --- tests/Hg.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Hg.js b/tests/Hg.js index a308fbac..d4dc0627 100644 --- a/tests/Hg.js +++ b/tests/Hg.js @@ -99,6 +99,8 @@ Test('Cloning multiple live Hg repositories into one.', async (assert) => { DirectoryCompare.compare(Path.join(testDirectory, 'whoosh'), Path.join(outputDirectory, 'whoosh'), exclude), DirectoryCompare.compare(Path.join(testDirectory, 'hg-git'), Path.join(outputDirectory, 'hg-git'), exclude), ]).spread((compare1, compare2) => { + console.log(compare1) + console.log(compare2) assert.true(compare1.same, 'First repo didnt match'); assert.true(compare2.same, 'Second repo did not match'); }); From 0ef1ebc30c2bb09bf0a31504244e7ec601ad601f Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 13:48:44 -0400 Subject: [PATCH 04/12] Reverting fs-extra --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40ce7670..8597045d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "blue-tape": "^1.0.0", "bluebird": "^3.5.1", "dir-compare": "^1.4.0", - "fs-extra": "^5.0.0", + "fs-extra": "^4.0.2", "globby": "^8.0.1", "is-there": "^4.4.3", "shortid": "^2.2.8", From 0410477c65c971553e8f21dac199295d3d317593 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 14:21:55 -0400 Subject: [PATCH 05/12] Reverting upgrade to globby --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8597045d..2c6ea822 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "bluebird": "^3.5.1", "dir-compare": "^1.4.0", "fs-extra": "^4.0.2", - "globby": "^8.0.1", + "globby": "^6.1.0", "is-there": "^4.4.3", "shortid": "^2.2.8", "tempy": "^0.2.1", From 948d90fe8203f9e05febee2c892596f60f831f04 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 14:29:20 -0400 Subject: [PATCH 06/12] Incremental update of globby --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2c6ea822..25f4577b 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "blue-tape": "^1.0.0", "bluebird": "^3.5.1", "dir-compare": "^1.4.0", - "fs-extra": "^4.0.2", - "globby": "^6.1.0", + "fs-extra": "^5.0.0", + "globby": "^7.0.0", "is-there": "^4.4.3", "shortid": "^2.2.8", "tempy": "^0.2.1", From 7706e3ac170131b917a86112f3c4921dd2afde36 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 15:37:41 -0400 Subject: [PATCH 07/12] Adding expandDirectories option and updating error condition - Also linting --- src/Command.js | 5 ++- src/Hg.js | 48 +++++++++++++++++--------- src/HgRepo.js | 93 +++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 108 insertions(+), 38 deletions(-) diff --git a/src/Command.js b/src/Command.js index bad53f2d..1e226ca9 100644 --- a/src/Command.js +++ b/src/Command.js @@ -1,5 +1,3 @@ -'use-strict'; - const Exec = require('child_process').exec; const Promise = require('bluebird'); const Utils = require('./Utils'); @@ -21,7 +19,7 @@ function run(command, directory = process.cwd(), options = []) { }); } -async function runWithHandling(command, directory = process.cwd(), options = [], done){ +async function runWithHandling(command, directory = process.cwd(), options = [], done) { try { const output = await run(command, directory, options); @@ -30,6 +28,7 @@ async function runWithHandling(command, directory = process.cwd(), options = [], return Utils.asCallback(output.error, output.stdout, done); } } + module.exports = { run, runWithHandling, diff --git a/src/Hg.js b/src/Hg.js index 72675693..da87166f 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -14,7 +14,9 @@ async function getSourceInfo(source, pythonPath) { let sourceURL = null; if (source.constructor !== String && source.constructor !== Object) { - throw new TypeError('Incorrect type of from parameter. Clone source in the array is an invalid type. Must be an String or an Object'); + throw new TypeError( + 'Incorrect type of from parameter. Clone source in the array is an invalid type. Must be an String or an Object', + ); } if (source.constructor === Object) sourceURL = source.url; @@ -29,7 +31,11 @@ async function getSourceInfo(source, pythonPath) { await cloneSingle(source, { path: sourceRepoPath, url: sourceURL }, pythonPath); } catch (error) { - if (error.code !== 'ERR_INVALID_URL' && !(error.message && error.message.includes('Invalid URL'))) throw error; + if ( + error.code !== 'ERR_INVALID_URL' && + !(error.message && error.message.includes('Invalid URL')) + ) + throw error; sourceRepoPath = source; sourceRepoName = Path.basename(source); @@ -43,22 +49,27 @@ async function cloneSingle(from, to, pythonPath) { let url; if (from.constructor === Object) { - repo = new HgRepo(to || { - url: from.url, - password: from.password, - username: from.username, - }, pythonPath); + repo = new HgRepo( + to || { + url: from.url, + password: from.password, + username: from.username, + }, + pythonPath, + ); url = Utils.buildRepoURL(from); } else { - repo = new HgRepo(to || { - url: from, - }, pythonPath); + repo = new HgRepo( + to || { + url: from, + }, + pythonPath, + ); url = from; } await Utils.ensureRepoPath(repo.path); - await Command.run('hg clone', repo.path, [url, repo.path]); return repo; @@ -69,10 +80,9 @@ async function cloneMultipleAndMerge(from, to, pythonPath) { const combinedRepo = new HgRepo(to, pythonPath); await Utils.ensureRepoPath(combinedRepo.path); - await combinedRepo.init(); - await Promise.each(from, async (repo) => { + await Promise.each(from, async repo => { const [repoName, repoPath] = await getSourceInfo(repo, pythonPath); let repoDir = repoName; @@ -83,7 +93,11 @@ async function cloneMultipleAndMerge(from, to, pythonPath) { await combinedRepo.pull({ source: repoPath, force: true }); await combinedRepo.update({ clean: true, revision: 'default' }); - const files = await Globby(['*', '!.hg'], { dot: true, cwd: combinedRepo.path }); + const files = await Globby(['*', '!.hg'], { + expandDirectories: true, + dot: true, + cwd: combinedRepo.path, + }); const subDirectory = Path.join(combinedRepo.path, repoDir); await Utils.moveFiles(combinedRepo.path, subDirectory, files); @@ -106,8 +120,10 @@ async function cloneMultipleAndMerge(from, to, pythonPath) { try { await combinedRepo.commit(`Merging ${repoName} into combined`); } catch (error) { - if (!error.message.includes('nothing to merge') && - !error.message.includes('merging with a working directory ancestor')) { + if ( + !error.message.includes('nothing to merge') && + !error.message.includes('merging with a working directory ancestor') + ) { throw error; } } diff --git a/src/HgRepo.js b/src/HgRepo.js index 4b78a692..bc6cba8b 100644 --- a/src/HgRepo.js +++ b/src/HgRepo.js @@ -11,14 +11,19 @@ async function ensureGitify(pythonPath) { if (output.error.message.includes('ImportError')) { const gitifyPath = Path.resolve('utils', 'gitifyhg', 'setup.py'); - throw new ReferenceError(`Must install gitifyhg. Run this command: ${pythonPath} ${gitifyPath} install`); + throw new ReferenceError( + `Must install gitifyhg. Run this command: ${pythonPath} ${gitifyPath} install`, + ); } } } class HgRepo { constructor({ name, url, username = '', password = '', path } = {}, pythonPath = 'python') { - if (!url && !path && !name) throw new Error('Must supply a remote url, a name, or a path when creating a HgRepo instance'); + if (!url || !path || !name) + throw new Error( + 'Must supply a remote url, a name, or a path when creating a HgRepo instance', + ); this.url = url; this.username = username; @@ -67,7 +72,15 @@ class HgRepo { return Utils.asCallback(output.error, output.stdout, done); } - async gitify({ path = Path.resolve(Path.dirname(this.path), `${this.name}-git`), remoteURL, trackAll = false, clean = false } = {}, done) { + async gitify( + { + path = Path.resolve(Path.dirname(this.path), `${this.name}-git`), + remoteURL, + trackAll = false, + clean = false, + } = {}, + done, + ) { const checkVersion = await Command.run(`${this.pythonPath} -V`); let cloneCmd; @@ -85,7 +98,7 @@ class HgRepo { await Command.run(cloneCmd); // Remove .hgtags from each folder - const files = await Globby(['**/.hgtags'], { dot: true, cwd: path }); + const files = await Globby(['**/.hgtags'], { expandDirectories: true, dot: true, cwd: path }); if (files.length) { await Promise.all(files.map(hgpath => Fs.remove(Path.resolve(path, hgpath)))); @@ -94,22 +107,30 @@ class HgRepo { } // Rename .hgignore to .gitignore, and remove the line syntax:* - const hgIgnoreFiles = await Globby(['**/.hgignore'], { dot: true, cwd: path }); + const hgIgnoreFiles = await Globby(['**/.hgignore'], { + expandDirectories: true, + dot: true, + cwd: path, + }); if (hgIgnoreFiles.length) { - await Promise.all(hgIgnoreFiles.map(async (ignoreFile) => { - const dir = Path.dirname(ignoreFile); - const newPath = Path.resolve(path, dir, '.gitignore'); + await Promise.all( + hgIgnoreFiles.map(async ignoreFile => { + const dir = Path.dirname(ignoreFile); + const newPath = Path.resolve(path, dir, '.gitignore'); - Fs.renameSync(Path.resolve(path, ignoreFile), newPath); + Fs.renameSync(Path.resolve(path, ignoreFile), newPath); - const data = Fs.readFileSync(newPath, 'utf8'); + const data = Fs.readFileSync(newPath, 'utf8'); - return Fs.outputFile(newPath, data.replace(/syntax(.*)\n/, '')); - })); + return Fs.outputFile(newPath, data.replace(/syntax(.*)\n/, '')); + }), + ); await Command.run('git add', path, ['-A']); - await Command.run('git commit', path, ['-m "Changing .hgignore to be .gitignore and removing syntax line"']); + await Command.run('git commit', path, [ + '-m "Changing .hgignore to be .gitignore and removing syntax line"', + ]); } if (remoteURL) { @@ -127,7 +148,6 @@ class HgRepo { await Fs.remove(Path.join(path, '.git', 'hg')); await Fs.remove(Path.join(path, '.git', 'refs', 'hg')); - return Utils.asCallback(null, null, done); } @@ -151,7 +171,7 @@ class HgRepo { const paths = {}; const lines = pathsString.stdout.split('\n'); - lines.forEach((line) => { + lines.forEach(line => { if (line === '') return; const name = line.match(/(^.+)\s=/)[0]; @@ -163,7 +183,20 @@ class HgRepo { return Utils.asCallback(null, paths, done); } - async pull({ source = this.url, force = false, update = false, revision, bookmark, branch, newBranch = false, ssh, insecure = false } = {}, done) { + async pull( + { + source = this.url, + force = false, + update = false, + revision, + bookmark, + branch, + newBranch = false, + ssh, + insecure = false, + } = {}, + done, + ) { const optionArgs = []; if (!source) throw new Error('Missing remote url to pull from'); @@ -182,7 +215,21 @@ class HgRepo { return Command.runWithHandling('hg pull', this.path, optionArgs, done); } - async push({ destination = this.url, password, username, force = false, revision, bookmark, branch, newBranch = false, ssh, insecure = false } = {}, done) { + async push( + { + destination = this.url, + password, + username, + force = false, + revision, + bookmark, + branch, + newBranch = false, + ssh, + insecure = false, + } = {}, + done, + ) { const optionArgs = []; if (!destination) throw new Error('Missing remote url to push to'); @@ -200,7 +247,10 @@ class HgRepo { return Command.runWithHandling('hg push', this.path, optionArgs, done); } - async remove({ files = [''], include, exclude, subrepos = false, force = false, after = false } = {}, done) { + async remove( + { files = [''], include, exclude, subrepos = false, force = false, after = false } = {}, + done, + ) { const optionArgs = []; optionArgs.push(files.join(' ')); @@ -214,7 +264,12 @@ class HgRepo { return Command.runWithHandling('hg remove', this.path, optionArgs, done); } - async rename(source, destination, { after = false, force = false, include, exclude, dryRun = false } = {}, done) { + async rename( + source, + destination, + { after = false, force = false, include, exclude, dryRun = false } = {}, + done, + ) { const optionArgs = []; optionArgs.push(source); From 719ac5d0d361561382795894435441ba5b02d489 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 15:42:01 -0400 Subject: [PATCH 08/12] Reverting error condition --- src/HgRepo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HgRepo.js b/src/HgRepo.js index bc6cba8b..99fabcec 100644 --- a/src/HgRepo.js +++ b/src/HgRepo.js @@ -20,7 +20,7 @@ async function ensureGitify(pythonPath) { class HgRepo { constructor({ name, url, username = '', password = '', path } = {}, pythonPath = 'python') { - if (!url || !path || !name) + if (!url && !path && !name) throw new Error( 'Must supply a remote url, a name, or a path when creating a HgRepo instance', ); From 9a76fea51674936750d378b45938a9b7ece4129b Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 15:50:59 -0400 Subject: [PATCH 09/12] Switching nodir and removing consolelogs --- src/Hg.js | 2 +- src/HgRepo.js | 4 ++-- tests/Hg.js | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Hg.js b/src/Hg.js index da87166f..cf2bacbf 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -94,7 +94,7 @@ async function cloneMultipleAndMerge(from, to, pythonPath) { await combinedRepo.update({ clean: true, revision: 'default' }); const files = await Globby(['*', '!.hg'], { - expandDirectories: true, + nodir: false, dot: true, cwd: combinedRepo.path, }); diff --git a/src/HgRepo.js b/src/HgRepo.js index 99fabcec..935d483d 100644 --- a/src/HgRepo.js +++ b/src/HgRepo.js @@ -98,7 +98,7 @@ class HgRepo { await Command.run(cloneCmd); // Remove .hgtags from each folder - const files = await Globby(['**/.hgtags'], { expandDirectories: true, dot: true, cwd: path }); + const files = await Globby(['**/.hgtags'], { nodir: false, dot: true, cwd: path }); if (files.length) { await Promise.all(files.map(hgpath => Fs.remove(Path.resolve(path, hgpath)))); @@ -108,7 +108,7 @@ class HgRepo { // Rename .hgignore to .gitignore, and remove the line syntax:* const hgIgnoreFiles = await Globby(['**/.hgignore'], { - expandDirectories: true, + nodir: false, dot: true, cwd: path, }); diff --git a/tests/Hg.js b/tests/Hg.js index d4dc0627..a308fbac 100644 --- a/tests/Hg.js +++ b/tests/Hg.js @@ -99,8 +99,6 @@ Test('Cloning multiple live Hg repositories into one.', async (assert) => { DirectoryCompare.compare(Path.join(testDirectory, 'whoosh'), Path.join(outputDirectory, 'whoosh'), exclude), DirectoryCompare.compare(Path.join(testDirectory, 'hg-git'), Path.join(outputDirectory, 'hg-git'), exclude), ]).spread((compare1, compare2) => { - console.log(compare1) - console.log(compare2) assert.true(compare1.same, 'First repo didnt match'); assert.true(compare2.same, 'Second repo did not match'); }); From cedae93633cb297971af44f9ea682d5d1ee8ca1f Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 16:00:37 -0400 Subject: [PATCH 10/12] Updating globby to the latest version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25f4577b..15677524 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "bluebird": "^3.5.1", "dir-compare": "^1.4.0", "fs-extra": "^5.0.0", - "globby": "^7.0.0", + "globby": "^8.0.1", "is-there": "^4.4.3", "shortid": "^2.2.8", "tempy": "^0.2.1", From 96600003945a43fd677dd7bd02d83505b402bb8d Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 16:05:16 -0400 Subject: [PATCH 11/12] Trying to narrow down the breaking version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15677524..ac38078e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "bluebird": "^3.5.1", "dir-compare": "^1.4.0", "fs-extra": "^5.0.0", - "globby": "^8.0.1", + "globby": "^7.1.1", "is-there": "^4.4.3", "shortid": "^2.2.8", "tempy": "^0.2.1", From 3cebb9244e81244301b30e4dae3a83de12a101e1 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 29 Apr 2018 16:17:57 -0400 Subject: [PATCH 12/12] Updating to match fast-glob options --- package.json | 2 +- src/Hg.js | 2 +- src/HgRepo.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ac38078e..15677524 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "bluebird": "^3.5.1", "dir-compare": "^1.4.0", "fs-extra": "^5.0.0", - "globby": "^7.1.1", + "globby": "^8.0.1", "is-there": "^4.4.3", "shortid": "^2.2.8", "tempy": "^0.2.1", diff --git a/src/Hg.js b/src/Hg.js index cf2bacbf..77dd73c7 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -94,7 +94,7 @@ async function cloneMultipleAndMerge(from, to, pythonPath) { await combinedRepo.update({ clean: true, revision: 'default' }); const files = await Globby(['*', '!.hg'], { - nodir: false, + onlyFiles: false, dot: true, cwd: combinedRepo.path, }); diff --git a/src/HgRepo.js b/src/HgRepo.js index 935d483d..a004f9aa 100644 --- a/src/HgRepo.js +++ b/src/HgRepo.js @@ -98,7 +98,7 @@ class HgRepo { await Command.run(cloneCmd); // Remove .hgtags from each folder - const files = await Globby(['**/.hgtags'], { nodir: false, dot: true, cwd: path }); + const files = await Globby(['**/.hgtags'], { onlyFiles: false, dot: true, cwd: path }); if (files.length) { await Promise.all(files.map(hgpath => Fs.remove(Path.resolve(path, hgpath)))); @@ -108,7 +108,7 @@ class HgRepo { // Rename .hgignore to .gitignore, and remove the line syntax:* const hgIgnoreFiles = await Globby(['**/.hgignore'], { - nodir: false, + onlyFiles: false, dot: true, cwd: path, });