Mercurial > hg-git-serve
diff src/hgext3rd/hggit_serve/_export.py @ 14:959ef686193f
Add user-facing documentation.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Fri, 20 Feb 2026 21:05:31 -0500 |
| parents | 00bdfac5416c |
| children | 78ea1ec94be5 |
line wrap: on
line diff
--- a/src/hgext3rd/hggit_serve/_export.py Thu Feb 19 01:13:56 2026 -0500 +++ b/src/hgext3rd/hggit_serve/_export.py Fri Feb 20 21:05:31 2026 -0500 @@ -151,15 +151,25 @@ # Hooks # +_AX_ALWAYS = b'always' +_AX_DEFAULT = b'default' +_AX_NEVER = b'never' + def _export_hook(ui: hgui.ui, repo: hgrepo.IRepo, **__: object) -> None: """Maybe exports the repository to get after we get new revs.""" if not is_gitty(repo): return auto_export = ui.config(b'hggit-serve', b'auto-export') - if auto_export == b'never': + if auto_export == _AX_NEVER: return - if auto_export == b'always' or git_handler.has_gitrepo(repo): + if auto_export == _AX_ALWAYS or git_handler.has_gitrepo(repo): + if auto_export not in (None, _AX_ALWAYS, _AX_DEFAULT): + ui.warn( + b'unrecognized auto-export setting %s; using %s', + auto_export, + _AX_DEFAULT, + ) if _is_importing(repo): ui.note(b'currently importing revs from git; not exporting\n') return
