Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Run Mercurial Activity extension to provide graphs for the given time spans
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

grunt-hgactivity

Visualise activity in Mercurial repository

Provides a Grunt task that runs the command hg activity with the given options. This task can be configured to split the activity graphic based on the given time span.

The project that this task is used, should use Mercurial as its version control system and the current user should have the Activity Extension installed.

Dependency Status Code Climate Built with Grunt Analytics

Getting Started

Add this to your project's Gruntfile.js configuration:

grunt.loadNpmTasks('grunt-hgactivity');

Then add grunt-hgactivity to your "package.json" dependencies. This can be done with:

npm install grunt-hgactivity --save-dev

Or by manually editing the "package.json" by adding the following line inside devDependencies object:

  "grunt-hgactivity": "~0.1"

Later on it would be possible to install the plugin with the command npm install

It can be updated with the command npm update, in case there is a newer version in the NPM repository.

The name to use in your own task definitions is hgactivity.

Documentation

Add an entry to your "Gruntfile.js", within the initConfig object. Current values shown are the defaults.

  ...

  hgactivity: {
    main: {
      options: {
        split: ['none'], // 'none', 'authors', 'files', 'branches', 'directories',
        filenamePrefix: 'activity',
        width: 800,
        height: 600,
        datemin: '', // yyyy-mm-dd, if left empty, will use 6 months ago
        datemax: '', // yyyy-mm-dd, if empty will use today
        interval: '3m', // int followed by: y = years, m = months, w = weeks, d = days
        iterations: 4, // number of iterations the interval should be useds
        uselines: true,
        showtags: false,
        imagetitle: '', // prefix which will be followed by the split if not none and time span
        cwindow: 2
      }
    }
  }

  ...

To run it:

grunt hgactivity

Multiple targets

It can be configured to have multiple targets, for example like this:

hgactivity: {
  quartal: {
    options: {
      split: ['none', 'files', 'directories'],
      filenamePrefix: 'quartal',
      width: 1200,
      height: 800,
      imagetitle: 'Quartal ',
      interval: '3m',
      iterations: 20,
      datemax: '2013-06-31'
    }
  },
  yearly: {
    options: {
      split: ['authors'],
      filenamePrefix: 'yearly',
      width: 1200,
      height: 800,
      imagetitle: 'Yearly ',
      interval: '1y',
      iterations: 12,
      datemax: '2013-12-31'
    }
  },
  all: {
    options: {
      split: ['none'],
      filenamePrefix: 'all',
      width: 1600,
      height: 1400,
      imagetitle: 'All time',
      interval: null,
      uselines: false,
      showtags: true
    }
  }
}

Now to run a specific task, the following command can be used:

grunt hgactivity:yearly

Dependencies

Activity Mercurial plugin troubleshooting for Windows

Easiest way to fullfill the dependencies for the Hg Activity Plugin, is to install the Scipy-stack.

It might also be needed to manually edit the plugin code in order for it to find its requirements. Open the activity/__init__.py file and add the following lines on the top:

import sys
sys.path.append(r'C:\\Python27\\Lib\\site-packages')
sys.path.append(r'C:\\Python27\\Lib')

Changelog

  • 2015-01-06 v0.1.5 Dependencies updated and Moment API changes
  • 2014-08-23 v0.1.4 Dependencies updated
  • 2013-12-20 v0.1.3 Grunt migrated to 0.4.2 (which was trivial as changing version number). Eslint instead of JSHint
  • 2013-07-24 v0.1.2 Failed to update version numbers in previous tagged release
  • 2013-07-24 v0.1.1 Removed 'hours' time span option
  • 2013-07-23 v0.1.0 Initial release

Contributing

Please refer to a GitHub blog post on how to create somewhat perfect pull request.

License

Copyright (c) Juga Paazmaya olavic@gmail.com

Licensed under the MIT license.

Something went wrong with that request. Please try again.