Patchwork [2,of,6] lfs: dedent documentation section about .hglfs file

login
register
mail settings
Submitter Denis Laxalde
Date Oct. 21, 2019, 10 a.m.
Message ID <70764c9ddba397fa6cc2.1571652054@marimba>
Download mbox | patch
Permalink /patch/42511/
State Accepted
Headers show

Comments

Denis Laxalde - Oct. 21, 2019, 10 a.m.
# HG changeset patch
# User Denis Laxalde <denis@laxalde.org>
# Date 1571648903 -7200
#      Mon Oct 21 11:08:23 2019 +0200
# Node ID 70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
# Parent  f6d36e1d008ac5eaaccfaeb2a598cdbdf1d36391
lfs: dedent documentation section about .hglfs file

The leading ".hglfs::" is interpreted as a macro in generated man page
and, as it is unknown, the whole section does not render. Also, having
the section marked as preformatted (::) makes it render verbatim in
HTML, which is not desired as the text contains formatting markers. So
we just dedent the section and remove the ".hglfs::" line. The example
file is still indented and rendered preformatted.
Yuya Nishihara - Oct. 21, 2019, 1:40 p.m.
On Mon, 21 Oct 2019 12:00:54 +0200, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis@laxalde.org>
> # Date 1571648903 -7200
> #      Mon Oct 21 11:08:23 2019 +0200
> # Node ID 70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> # Parent  f6d36e1d008ac5eaaccfaeb2a598cdbdf1d36391
> lfs: dedent documentation section about .hglfs file

Queued this, thanks.
Matt Harbison - Oct. 22, 2019, 2:37 a.m.
On Mon, 21 Oct 2019 06:00:54 -0400, Denis Laxalde <denis@laxalde.org>  
wrote:

> # HG changeset patch
> # User Denis Laxalde <denis@laxalde.org>
> # Date 1571648903 -7200
> #      Mon Oct 21 11:08:23 2019 +0200
> # Node ID 70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> # Parent  f6d36e1d008ac5eaaccfaeb2a598cdbdf1d36391
> lfs: dedent documentation section about .hglfs file
>
> The leading ".hglfs::" is interpreted as a macro in generated man page
> and, as it is unknown, the whole section does not render. Also, having
> the section marked as preformatted (::) makes it render verbatim in
> HTML, which is not desired as the text contains formatting markers. So
> we just dedent the section and remove the ".hglfs::" line. The example
> file is still indented and rendered preformatted.

Is there a way to keep ".hglfs" (or similar) as a section header of sorts,  
like `Configs` below it?  There's a lot of text here, and the visual break  
makes it easier to read.

Patch

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -53,31 +53,29 @@  locally.  Both committing and downloadin
 file to a usercache, to speed up future access.  See the `usercache`
 config setting described below.
 
-.hglfs::
+The extension reads its configuration from a versioned ``.hglfs``
+configuration file found in the root of the working directory. The
+``.hglfs`` file uses the same syntax as all other Mercurial
+configuration files. It uses a single section, ``[track]``.
 
-    The extension reads its configuration from a versioned ``.hglfs``
-    configuration file found in the root of the working directory. The
-    ``.hglfs`` file uses the same syntax as all other Mercurial
-    configuration files. It uses a single section, ``[track]``.
-
-    The ``[track]`` section specifies which files are stored as LFS (or
-    not). Each line is keyed by a file pattern, with a predicate value.
-    The first file pattern match is used, so put more specific patterns
-    first.  The available predicates are ``all()``, ``none()``, and
-    ``size()``. See "hg help filesets.size" for the latter.
+The ``[track]`` section specifies which files are stored as LFS (or
+not). Each line is keyed by a file pattern, with a predicate value.
+The first file pattern match is used, so put more specific patterns
+first.  The available predicates are ``all()``, ``none()``, and
+``size()``. See "hg help filesets.size" for the latter.
 
-    Example versioned ``.hglfs`` file::
+Example versioned ``.hglfs`` file::
 
-      [track]
-      # No Makefile or python file, anywhere, will be LFS
-      **Makefile = none()
-      **.py = none()
+  [track]
+  # No Makefile or python file, anywhere, will be LFS
+  **Makefile = none()
+  **.py = none()
 
-      **.zip = all()
-      **.exe = size(">1MB")
+  **.zip = all()
+  **.exe = size(">1MB")
 
-      # Catchall for everything not matched above
-      ** = size(">10MB")
+  # Catchall for everything not matched above
+  ** = size(">10MB")
 
 Configs::