From a73a964e51247ed169d322c725a3a18859f109a3 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Mon, 14 Jun 2021 00:00:37 +0000 Subject: python, hg: tow outside the environment. they've served us well, and can ride off into the sunset. --- sys/src/cmd/hg/contrib/python-hook-examples.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 sys/src/cmd/hg/contrib/python-hook-examples.py (limited to 'sys/src/cmd/hg/contrib/python-hook-examples.py') diff --git a/sys/src/cmd/hg/contrib/python-hook-examples.py b/sys/src/cmd/hg/contrib/python-hook-examples.py deleted file mode 100644 index 54fb7d348..000000000 --- a/sys/src/cmd/hg/contrib/python-hook-examples.py +++ /dev/null @@ -1,22 +0,0 @@ -''' -Examples of useful python hooks for Mercurial. -''' -from mercurial import patch, util - -def diffstat(ui, repo, **kwargs): - '''Example usage: - - [hooks] - commit.diffstat = python:/path/to/this/file.py:diffstat - changegroup.diffstat = python:/path/to/this/file.py:diffstat - ''' - if kwargs.get('parent2'): - return - node = kwargs['node'] - first = repo[node].parents()[0].node() - if 'url' in kwargs: - last = repo['tip'].node() - else: - last = node - diff = patch.diff(repo, first, last) - ui.write(patch.diffstat(util.iterlines(diff))) -- cgit v1.2.3