Skip to content

Commit

Permalink
Fixed parameter -a/-A for hg commit and added tag functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Straube committed Aug 19, 2019
1 parent abd2d1d commit 273685b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/HgRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class HgRepo {
const optionalArgs = [];
let output;

if (add) optionalArgs.push('-a');
if (add) optionalArgs.push('-A');

optionalArgs.push(`-m "${message}"`);

Expand Down Expand Up @@ -296,6 +296,16 @@ class HgRepo {

return Command.runWithHandling('hg update', this.path, optionArgs, done);
}

async tag({ force = true, message, tagName } = {}, done) {
const optionArgs = [];

if (tagName) optionArgs.push(tagName);
if (force) optionArgs.push(' -f');
if (message) optionArgs.push(` -m ${message}`);

return Command.runWithHandling('hg tag', this.path, optionArgs, done);
}
}

module.exports = HgRepo;

0 comments on commit 273685b

Please sign in to comment.