From 3c708d57105f4774d4b1d68c5c8f2439c5f12f48 Mon Sep 17 00:00:00 2001 From: kfirprods Date: Sun, 1 Oct 2017 22:04:21 +0300 Subject: [PATCH 1/3] added Hg.identify --- src/Hg.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Hg.js b/src/Hg.js index d0750ad6..991ab4f2 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -174,6 +174,10 @@ class Hg { static async version(done) { return Command.runWithHandling('hg --version', undefined, undefined, done); } + + async identify(remoteUrl, done) { + return Command.runWithHandling(`hg identify ${remoteUrl}`, undefined, undefined, done); + } } module.exports = Hg; From 9969d22d19fa57da58ca0cc2ff54839c3fe14b95 Mon Sep 17 00:00:00 2001 From: kfirprods Date: Tue, 3 Oct 2017 22:08:58 +0300 Subject: [PATCH 2/3] CR fix: identify method made static --- src/Hg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hg.js b/src/Hg.js index 991ab4f2..36897ed7 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -175,7 +175,7 @@ class Hg { return Command.runWithHandling('hg --version', undefined, undefined, done); } - async identify(remoteUrl, done) { + static async identify(remoteUrl, done) { return Command.runWithHandling(`hg identify ${remoteUrl}`, undefined, undefined, done); } } From 15ae99d720b4b36bbe2775d0aed3825351353f45 Mon Sep 17 00:00:00 2001 From: kfirprods Date: Tue, 3 Oct 2017 22:13:54 +0300 Subject: [PATCH 3/3] oops - to be accessed from the Hg instance, I had to add a non static function too --- src/Hg.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Hg.js b/src/Hg.js index 36897ed7..77d45597 100644 --- a/src/Hg.js +++ b/src/Hg.js @@ -175,6 +175,10 @@ class Hg { return Command.runWithHandling('hg --version', undefined, undefined, done); } + identify(remoteUrl, done) { + return this.constructor.identify(remoteUrl, done); + } + static async identify(remoteUrl, done) { return Command.runWithHandling(`hg identify ${remoteUrl}`, undefined, undefined, done); }