Mercurial > hg-git-serve
comparison src/hgext3rd/hggit_serve/__init__.py @ 13:00bdfac5416c
Create Git SSH commands and add some documentation. Also cleanup.
- Adds git-upload-pack and git-receive-pack as hg subcommands,
to be run on the server side by git push/pull.
- Starts on documentation.
- Cleans up a lot of stuff.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Thu, 19 Feb 2026 01:13:56 -0500 |
| parents | f630d9904ea7 |
| children | 959ef686193f |
comparison
equal
deleted
inserted
replaced
| 12:f630d9904ea7 | 13:00bdfac5416c |
|---|---|
| 1 r"""hg serve the Git world | |
| 2 | |
| 3 This extension lets you serve Git users from a Mercurial world. After some | |
| 4 very basic setup, Git users can pull from *and push to* your repository | |
| 5 as if it were any other Git repository. | |
| 6 | |
| 7 For a quick example:: | |
| 8 | |
| 9 $ hg git-export | |
| 10 $ hg serve | |
| 11 | |
| 12 then in another terminal:: | |
| 13 | |
| 14 $ git clone http://localhost:8000/ # or wherever 'hg serve' ran | |
| 15 | |
| 16 This works atop the ``hggit`` extension, and (unlike ``hggit``) requires that | |
| 17 you have Git installed (maybe this will go away in a future version?). | |
| 18 | |
| 19 Setup | |
| 20 ----- | |
| 21 | |
| 22 TODO | |
| 23 """ | |
| 24 | |
| 1 from __future__ import annotations | 25 from __future__ import annotations |
| 2 | 26 |
| 3 import typing as t | 27 from ._export import uipopulate |
| 4 | 28 from ._http import uisetup |
| 5 if t.TYPE_CHECKING: | 29 from ._ssh import cmdtable |
| 6 import mercurial.ui as hgui | |
| 7 | |
| 8 from . import _export | |
| 9 from . import _http | |
| 10 | 30 |
| 11 # | 31 # |
| 12 # Interfacing with Mercurial | 32 # Interfacing with Mercurial |
| 13 # | 33 # |
| 14 | 34 |
| 15 __version__ = '0.2.1' | 35 __version__ = '0.3.0' |
| 16 testedwith = b'7.1 7.2' | 36 testedwith = b'7.1 7.2' |
| 17 minimumhgversion = b'7.1' | 37 minimumhgversion = b'7.1' |
| 18 | 38 |
| 19 | 39 |
| 20 def uisetup(ui: hgui.ui) -> None: | |
| 21 _http.uisetup(ui) | |
| 22 | |
| 23 | |
| 24 def uipopulate(ui: hgui.ui) -> None: | |
| 25 _export.uipopulate(ui) | |
| 26 | |
| 27 | |
| 28 __all__ = ( | 40 __all__ = ( |
| 29 '__version__', | 41 '__version__', |
| 42 'cmdtable', | |
| 30 'minimumhgversion', | 43 'minimumhgversion', |
| 31 'testedwith', | 44 'testedwith', |
| 32 'uipopulate', | 45 'uipopulate', |
| 33 'uisetup', | 46 'uisetup', |
| 34 ) | 47 ) |
