[PATCH 1 of 5] hgweb: code selection without line numbers in file code view

Nikolaj Sjujskij sterkrig at myopera.com
Fri May 31 05:37:38 CDT 2013


Den 2013-05-31 14:35:08 skrev Alexander Plavin <me at aplavin.ru>:

> # HG changeset patch
> # User Alexander Plavin <me at aplavin.ru>
> # Date 1369988709 -14400
> #      Fri May 31 12:25:09 2013 +0400
> # Node ID fb5ca82f275afc3cbacd10441a9f55f1730a538d
> # Parent  1bef6f99a12d9062e737bb623da627719a3987e6
> hgweb: code selection without line numbers in file code view
>
> File code is presented as HTML ordered list, so that line numbers
> are not selected with the code itself. Long lines are wrapped for  
> convenience.
>
> diff -r 1bef6f99a12d -r fb5ca82f275a mercurial/templatefilters.py
> --- a/mercurial/templatefilters.py	Thu May 23 17:53:38 2013 -0500
> +++ b/mercurial/templatefilters.py	Fri May 31 12:25:09 2013 +0400
> @@ -354,6 +354,9 @@
>              .replace("'", ''')) # ' invalid in HTML
>      return re.sub('[\x00-\x08\x0B\x0C\x0E-\x1F]', ' ', text)
> +def spaceifempty(text):
> +    return text or ' '
> +
>  filters = {
>      "addbreaks": addbreaks,
>      "age": age,
> @@ -381,6 +384,7 @@
>      "short": short,
>      "shortbisect": shortbisect,
>      "shortdate": shortdate,
> +    'spaceifempty': spaceifempty,
>      "stringescape": stringescape,
>      "stringify": stringify,
>      "strip": strip,
  Inconsistent string quoting.


More information about the Mercurial-devel mailing list