diff 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
line wrap: on
line diff
--- a/src/hgext3rd/hggit_serve/__init__.py	Wed Feb 18 16:17:05 2026 -0500
+++ b/src/hgext3rd/hggit_serve/__init__.py	Thu Feb 19 01:13:56 2026 -0500
@@ -1,32 +1,45 @@
+r"""hg serve the Git world
+
+This extension lets you serve Git users from a Mercurial world. After some
+very basic setup, Git users can pull from *and push to* your repository
+as if it were any other Git repository.
+
+For a quick example::
+
+  $ hg git-export
+  $ hg serve
+
+then in another terminal::
+
+  $ git clone http://localhost:8000/  # or wherever 'hg serve' ran
+
+This works atop the ``hggit`` extension, and (unlike ``hggit``) requires that
+you have Git installed (maybe this will go away in a future version?).
+
+Setup
+-----
+
+TODO
+"""
+
 from __future__ import annotations
 
-import typing as t
-
-if t.TYPE_CHECKING:
-    import mercurial.ui as hgui
-
-from . import _export
-from . import _http
+from ._export import uipopulate
+from ._http import uisetup
+from ._ssh import cmdtable
 
 #
 # Interfacing with Mercurial
 #
 
-__version__ = '0.2.1'
+__version__ = '0.3.0'
 testedwith = b'7.1 7.2'
 minimumhgversion = b'7.1'
 
 
-def uisetup(ui: hgui.ui) -> None:
-    _http.uisetup(ui)
-
-
-def uipopulate(ui: hgui.ui) -> None:
-    _export.uipopulate(ui)
-
-
 __all__ = (
     '__version__',
+    'cmdtable',
     'minimumhgversion',
     'testedwith',
     'uipopulate',