~ludovicchabant

Recent activity

[PATCH hg.sr.ht] Move mercurial libs import to after we can log errors 14 days ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

# HG changeset patch
# User Ludovic Chabant <ludovic@chabant.com>
# Date 1599285632 0
#      Sat Sep 05 06:00:32 2020 +0000
# Node ID 297d500c6d18a0db3bd51676ed27d4cce97a3e59
# Parent  669a5606abe76fe3f806a96de5da49c826f2932f
Move mercurial libs import to after we can log errors

This is useful for reporting setup problems where mercurial wasn't installed
for python 3.

diff --git a/hgsrht-shell b/hgsrht-shell
--- a/hgsrht-shell
+++ b/hgsrht-shell
[message trimmed]

[PATCH hg.sr.ht] Use default value for redis-host if value is empty 14 days ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

# HG changeset patch
# User Ludovic Chabant <ludovic@chabant.com>
# Date 1599285550 0
#      Sat Sep 05 05:59:10 2020 +0000
# Node ID 669a5606abe76fe3f806a96de5da49c826f2932f
# Parent  e3fa5cda65a568c68abe15e2c3579b125bc2f575
Use default value for redis-host if value is empty

(porting commit 1bbbc0be from gitsrht)

diff --git a/hgsrht-keys/main.go b/hgsrht-keys/main.go
--- a/hgsrht-keys/main.go
+++ b/hgsrht-keys/main.go
@@ -7,7 +7,6 @@
[message trimmed]

Re: [PATCH hg.sr.ht] Allow long head names to wrap a month ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

Merged, thanks!

Re: [PATCH hg.sr.ht] Prevent wrapping filenames to preserve whitespace a month ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

I had missed this one, sorry about that. Merged now, thanks!

Re: [PATCH hg.sr.ht 1/1] Remove the on-disk repositories when cleaning autocreated repos a month ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

Gah, derp derp. Thanks for finding my bug! We actually had a couple occurrences of such left-over repos causing problems when the user wanted to create them again.

[PATCH hg.sr.ht] Fix for when a \0 somehow makes it into a commit message a month ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

# HG changeset patch
# User Ludovic Chabant <ludovic@chabant.com>
# Date 1597038726 0
#      Mon Aug 10 05:52:06 2020 +0000
# Node ID 28c18b22ab1c997ef12593943f847661039d68cf
# Parent  86af52e0b6817311d428552f5f935234d63d3107
Fix for when a \0 somehow makes it into a commit message

diff --git a/hgsrht/hg.py b/hgsrht/hg.py
--- a/hgsrht/hg.py
+++ b/hgsrht/hg.py
@@ -9,7 +9,7 @@
import re

[message trimmed]

[PATCH scm.sr.ht] Don't render null hyperlinks in revision diff pages 4 months ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

---
 scmsrht/templates/partials/scmpatch.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scmsrht/templates/partials/scmpatch.html b/scmsrht/templates/partials/scmpatch.html
index 96ec44c..ff0f810 100644
--- a/scmsrht/templates/partials/scmpatch.html
+++ b/scmsrht/templates/partials/scmpatch.html
@@ -79,10 +79,10 @@
            class="text-info"
            >@@ <a
              style="text-decoration: underline"
              href="{{change.old_file.url}}#L{{hunk.old_start}}"
              {%if change.old_file.url%}href="{{change.old_file.url}}#L{{hunk.old_start}}"{%endif%}
[message trimmed]

Re: [PATCH hg.sr.ht] Use mercurial's python perf improvements 4 months ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

On Fri, Apr 24, 2020, at 15:37, Drew DeVault wrote:
> Can you explain in more detail what this does?

This uses Mercurial's "lazy import" optimization which I think
(although I'm not 100% sure exactly) delays "import foo" statements
until "foo" is actually needed. This allows costly module loading to
be done only when a particular execution code path goes into that kind
of situation... this avoids having to move import statements in weird
places inside "if" blocks and what not. It dramatically reduces the
startup time of mercurial in some cases (again, based on the particular
execution path). In our case, here, I shaves a couple seconds off the
script as far as I can tell.

Re: [PATCH hg.sr.ht] Use mercurial's python perf improvements 4 months ago

From Ludovic Chabant to ~sircmpwn/sr.ht-dev

If there are any Mercurial gurus in the audience, I would welcome other
tips to improve performance. Cheers!