##// END OF EJS Templates
contrib: python-hook-examples use absolute_import
Pulkit Goyal -
r28562:2b585677 default
parent child Browse files
Show More
@@ -1,22 +1,26
1 1 '''
2 2 Examples of useful python hooks for Mercurial.
3 3 '''
4 from mercurial import patch, util
4 from __future__ import absolute_import
5 from mercurial import (
6 patch,
7 util,
8 )
5 9
6 10 def diffstat(ui, repo, **kwargs):
7 11 '''Example usage:
8 12
9 13 [hooks]
10 14 commit.diffstat = python:/path/to/this/file.py:diffstat
11 15 changegroup.diffstat = python:/path/to/this/file.py:diffstat
12 16 '''
13 17 if kwargs.get('parent2'):
14 18 return
15 19 node = kwargs['node']
16 20 first = repo[node].p1().node()
17 21 if 'url' in kwargs:
18 22 last = repo['tip'].node()
19 23 else:
20 24 last = node
21 25 diff = patch.diff(repo, first, last)
22 26 ui.write(patch.diffstat(util.iterlines(diff)))
@@ -1,124 +1,123
1 1 #require test-repo
2 2
3 3 $ cd "$TESTDIR"/..
4 4
5 5 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
6 6 contrib/import-checker.py not using absolute_import
7 7 contrib/import-checker.py requires print_function
8 contrib/python-hook-examples.py not using absolute_import
9 8 contrib/revsetbenchmarks.py not using absolute_import
10 9 contrib/revsetbenchmarks.py requires print_function
11 10 contrib/synthrepo.py not using absolute_import
12 11 doc/check-seclevel.py not using absolute_import
13 12 doc/gendoc.py not using absolute_import
14 13 doc/hgmanpage.py not using absolute_import
15 14 hgext/color.py not using absolute_import
16 15 hgext/eol.py not using absolute_import
17 16 hgext/extdiff.py not using absolute_import
18 17 hgext/factotum.py not using absolute_import
19 18 hgext/fetch.py not using absolute_import
20 19 hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
21 20 hgext/fsmonitor/pywatchman/__init__.py requires print_function
22 21 hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
23 22 hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
24 23 hgext/gpg.py not using absolute_import
25 24 hgext/graphlog.py not using absolute_import
26 25 hgext/hgcia.py not using absolute_import
27 26 hgext/hgk.py not using absolute_import
28 27 hgext/highlight/__init__.py not using absolute_import
29 28 hgext/highlight/highlight.py not using absolute_import
30 29 hgext/histedit.py not using absolute_import
31 30 hgext/largefiles/__init__.py not using absolute_import
32 31 hgext/largefiles/basestore.py not using absolute_import
33 32 hgext/largefiles/lfcommands.py not using absolute_import
34 33 hgext/largefiles/lfutil.py not using absolute_import
35 34 hgext/largefiles/localstore.py not using absolute_import
36 35 hgext/largefiles/overrides.py not using absolute_import
37 36 hgext/largefiles/proto.py not using absolute_import
38 37 hgext/largefiles/remotestore.py not using absolute_import
39 38 hgext/largefiles/reposetup.py not using absolute_import
40 39 hgext/largefiles/uisetup.py not using absolute_import
41 40 hgext/largefiles/wirestore.py not using absolute_import
42 41 hgext/mq.py not using absolute_import
43 42 hgext/rebase.py not using absolute_import
44 43 hgext/share.py not using absolute_import
45 44 hgext/win32text.py not using absolute_import
46 45 i18n/check-translation.py not using absolute_import
47 46 i18n/polib.py not using absolute_import
48 47 setup.py not using absolute_import
49 48 tests/filterpyflakes.py requires print_function
50 49 tests/generate-working-copy-states.py requires print_function
51 50 tests/get-with-headers.py requires print_function
52 51 tests/heredoctest.py requires print_function
53 52 tests/hypothesishelpers.py not using absolute_import
54 53 tests/hypothesishelpers.py requires print_function
55 54 tests/killdaemons.py not using absolute_import
56 55 tests/md5sum.py not using absolute_import
57 56 tests/mockblackbox.py not using absolute_import
58 57 tests/printenv.py not using absolute_import
59 58 tests/readlink.py not using absolute_import
60 59 tests/readlink.py requires print_function
61 60 tests/revlog-formatv0.py not using absolute_import
62 61 tests/run-tests.py not using absolute_import
63 62 tests/seq.py not using absolute_import
64 63 tests/seq.py requires print_function
65 64 tests/silenttestrunner.py not using absolute_import
66 65 tests/silenttestrunner.py requires print_function
67 66 tests/sitecustomize.py not using absolute_import
68 67 tests/svn-safe-append.py not using absolute_import
69 68 tests/svnxml.py not using absolute_import
70 69 tests/test-ancestor.py requires print_function
71 70 tests/test-atomictempfile.py not using absolute_import
72 71 tests/test-batching.py not using absolute_import
73 72 tests/test-batching.py requires print_function
74 73 tests/test-bdiff.py not using absolute_import
75 74 tests/test-bdiff.py requires print_function
76 75 tests/test-context.py not using absolute_import
77 76 tests/test-context.py requires print_function
78 77 tests/test-demandimport.py not using absolute_import
79 78 tests/test-demandimport.py requires print_function
80 79 tests/test-doctest.py not using absolute_import
81 80 tests/test-duplicateoptions.py not using absolute_import
82 81 tests/test-duplicateoptions.py requires print_function
83 82 tests/test-filecache.py not using absolute_import
84 83 tests/test-filecache.py requires print_function
85 84 tests/test-filelog.py not using absolute_import
86 85 tests/test-filelog.py requires print_function
87 86 tests/test-hg-parseurl.py not using absolute_import
88 87 tests/test-hg-parseurl.py requires print_function
89 88 tests/test-hgweb-auth.py not using absolute_import
90 89 tests/test-hgweb-auth.py requires print_function
91 90 tests/test-hgwebdir-paths.py not using absolute_import
92 91 tests/test-hybridencode.py not using absolute_import
93 92 tests/test-hybridencode.py requires print_function
94 93 tests/test-lrucachedict.py not using absolute_import
95 94 tests/test-lrucachedict.py requires print_function
96 95 tests/test-manifest.py not using absolute_import
97 96 tests/test-minirst.py not using absolute_import
98 97 tests/test-minirst.py requires print_function
99 98 tests/test-parseindex2.py not using absolute_import
100 99 tests/test-parseindex2.py requires print_function
101 100 tests/test-pathencode.py not using absolute_import
102 101 tests/test-pathencode.py requires print_function
103 102 tests/test-propertycache.py not using absolute_import
104 103 tests/test-propertycache.py requires print_function
105 104 tests/test-revlog-ancestry.py not using absolute_import
106 105 tests/test-revlog-ancestry.py requires print_function
107 106 tests/test-run-tests.py not using absolute_import
108 107 tests/test-simplemerge.py not using absolute_import
109 108 tests/test-status-inprocess.py not using absolute_import
110 109 tests/test-status-inprocess.py requires print_function
111 110 tests/test-symlink-os-yes-fs-no.py not using absolute_import
112 111 tests/test-trusted.py not using absolute_import
113 112 tests/test-trusted.py requires print_function
114 113 tests/test-ui-color.py not using absolute_import
115 114 tests/test-ui-color.py requires print_function
116 115 tests/test-ui-config.py not using absolute_import
117 116 tests/test-ui-config.py requires print_function
118 117 tests/test-ui-verbosity.py not using absolute_import
119 118 tests/test-ui-verbosity.py requires print_function
120 119 tests/test-url.py not using absolute_import
121 120 tests/test-url.py requires print_function
122 121 tests/test-walkrepo.py requires print_function
123 122 tests/test-wireproto.py requires print_function
124 123 tests/tinyproxy.py requires print_function
General Comments 0
You need to be logged in to leave comments. Login now