New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hg-plus

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hg-plus

A Mercurial client for Node

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Coverage Status Build Status Dependency Status devDependency Status

node-hg-plus

A node js client for Mercurial. Supports both Async/Await/Promises and Standard callbacks.

Supported node version => 7.6.0

Table of Contents

Install

# Install from npm

npm install -S hg-plus

To use the gitify function, you must also have python2.7.x installed as well as the shipped gitifyhg python addon. To install the addon simply run:

cd node_modules/hg-plus/utils/gitifyhg/
python2.7 setup.py install

Note this feature currently has mixed results on windows. Working on fixing that functionality for the next release.

Usage

Basic

// Initialize with default python path ('python')
const Hg = require('hg-plus')();

// Clone a repo using only the url string
let repo = await Hg.clone('http://hostname.com/my/repository/url')
	
await repo.add()
await repo.commit('my example commit')
await repo.push({ password: 'myPassword', username: 'username' })

Create and push a repository

const Hg = require('hg-plus')();

let to = { 
	url: 'http://hostname.com/my/repository/url', 
	username: 'me@host.com', 
	password: 'secret'
}

let repo = await Hg.create(to);

await repo.push()

Cloning from multiple repositories into a new one

const Hg = require('hg-plus')();

let to = { 
	url: 'http://hostname.com/my/repository/url'
}

let from = [
	'http://hostname.com/my/repository/url1', 
	'http://hostname.com/my/repository/url2', 
	'http://hostname.com/my/repository/url3'
]

let repo = await Hg.clone(from, to);

await repo.commit('I just created a repository from three other repositories!')
await repo.push({ 	
	username: 'me@host.com', 
	password: 'secret'
})

Tests

First make sure to change the global variable in tests/HgRepo called pythonPath to be a valid path to your python2.7.x installation. Then run:

npm test

LICENSE

MIT, No Attribution Required, Copyright 2016 Justin Dalrymple

Changelog

1.0.0 (2017-07-20)

  • Cleaned up old promise logic and replaced with async/await
  • Removed usless rest param arguments from many of the Hg functions for clarity
  • Added Object input to the Hg.Clone function (See API Docs above)
  • Cleaned up folder structure
  • Fixed the setting of the default url if none is passed in by the user
  • Fixed cloning from urls instead of local paths
  • Added various callback tests to ensure the callback backwards compatibility is maintained
  • Added default state tests for the HgRepo Object
  • Removed old dependancies now that Promises are more widely supported
  • Standardized the callback support to return in the form callback(error, results) always

NOTE: Upgrading from 0.8.0 to 1.0 will break your project. Ensure to add the function call to your require statement - require('hg-plus')()

Keywords

FAQs

Package last updated on 25 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc