Show More
@@ -44,6 +44,9 b' configitem(' | |||||
44 | default=False, |
|
44 | default=False, | |
45 | ) |
|
45 | ) | |
46 |
|
46 | |||
|
47 | getversion = gitutil.pygit2_version | |||
|
48 | ||||
|
49 | ||||
47 | # TODO: extract an interface for this in core |
|
50 | # TODO: extract an interface for this in core | |
48 | class gitstore(object): # store.basicstore): |
|
51 | class gitstore(object): # store.basicstore): | |
49 | def __init__(self, path, vfstype): |
|
52 | def __init__(self, path, vfstype): |
@@ -20,6 +20,19 b' def get_pygit2():' | |||||
20 | return pygit2_module |
|
20 | return pygit2_module | |
21 |
|
21 | |||
22 |
|
22 | |||
|
23 | def pygit2_version(): | |||
|
24 | mod = get_pygit2() | |||
|
25 | v = "N/A" | |||
|
26 | ||||
|
27 | if mod: | |||
|
28 | try: | |||
|
29 | v = mod.__version__ | |||
|
30 | except AttributeError: | |||
|
31 | pass | |||
|
32 | ||||
|
33 | return b"(pygit2 %s)" % v.encode("utf-8") | |||
|
34 | ||||
|
35 | ||||
23 | def togitnode(n): |
|
36 | def togitnode(n): | |
24 | """Wrapper to convert a Mercurial binary node to a unicode hexlified node. |
|
37 | """Wrapper to convert a Mercurial binary node to a unicode hexlified node. | |
25 |
|
38 |
@@ -16,6 +16,10 b' Setup:' | |||||
16 | > } |
|
16 | > } | |
17 |
|
17 | |||
18 |
|
18 | |||
|
19 | $ hg version -v --config extensions.git= | grep '^[E ]' | |||
|
20 | Enabled extensions: | |||
|
21 | git internal (pygit2 *) (glob) | |||
|
22 | ||||
19 |
|
|
23 | Test auto-loading extension works: | |
20 | $ mkdir nogit |
|
24 | $ mkdir nogit | |
21 | $ cd nogit |
|
25 | $ cd nogit |
General Comments 0
You need to be logged in to leave comments.
Login now