~ludovicchabant

Recent activity

[PATCH scm.sr.ht] Don't render null hyperlinks in revision diff pages a month 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 a month 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 a month 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!

[PATCH hg.sr.ht] Use mercurial's python perf improvements a month ago

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

# HG changeset patch
# User Ludovic Chabant <ludovic@chabant.com>
# Date 1587766847 0
#      Fri Apr 24 22:20:47 2020 +0000
# Node ID 20c9fb9061c383c2ded03d671d1d0fdbf946881f
# Parent  aaeee4366893b87470c310e3018360cc7444663f
Use mercurial's python perf improvements

diff --git a/hgsrht-shell b/hgsrht-shell
--- a/hgsrht-shell
+++ b/hgsrht-shell
@@ -10,6 +10,8 @@
from srht.config import cfg, get_origin

[message trimmed]

Re: [PATCH hg.sr.ht] Handle leftover data when autocreating repos a month ago

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

> You also seem to have incidentally resolved another bug I had in my
> queue, thanks :)

Heh :)   What bug was it, out of curiosity?

[PATCH hg.sr.ht] Handle leftover data when autocreating repos a month ago

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

# HG changeset patch
# User Ludovic Chabant <ludovic@chabant.com>
# Date 1587710815 0
#      Fri Apr 24 06:46:55 2020 +0000
# Node ID 936aada349d74a931b5c33181cbb19532bbc34c1
# Parent  aaeee4366893b87470c310e3018360cc7444663f
Handle leftover data when autocreating repos

diff --git a/hgsrht-shell b/hgsrht-shell
--- a/hgsrht-shell
+++ b/hgsrht-shell
@@ -215,11 +215,49 @@
    repo_info.path = path
    repo_info.visibility = 'autocreated'
[message trimmed]

Re: [PATCH hg.sr.ht] Rewrite hgsrht-shell to do all the work directly in the script a month ago

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

FYI, for those following at home, this patch was pushed upstream a while
ago, but the deployment was stalled for a while for convoluted reasons I
won't bore you with.

It's been deployed now for a few days. Ping me if you notice any
problems!

Re: Internal Server Error on pushing to non-existing repository a month ago

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

It's now fixed! Sorry for the trouble.

[PATCH scm.sr.ht] Add standard invalid repo page a month ago

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

---
 scmsrht/templates/invalid-repo.html | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 scmsrht/templates/invalid-repo.html

diff --git a/scmsrht/templates/invalid-repo.html b/scmsrht/templates/invalid-repo.html
new file mode 100644
index 0000000..0dc8303
--- /dev/null
+++ b/scmsrht/templates/invalid-repo.html
@@ -0,0 +1,36 @@
{% extends "repo.html" %}

{% block content %}
[message trimmed]

[PATCH git.sr.ht] Use scmsrht's contributors template and API a month ago

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

---
 gitsrht/blueprints/stats.py         | 61 +++--------------------------
 gitsrht/templates/contributors.html | 48 +----------------------
 2 files changed, 8 insertions(+), 101 deletions(-)

diff --git a/gitsrht/blueprints/stats.py b/gitsrht/blueprints/stats.py
index 57a9f3e..90bef8f 100644
--- a/gitsrht/blueprints/stats.py
+++ b/gitsrht/blueprints/stats.py
@@ -1,30 +1,15 @@
import pygit2
from collections import defaultdict
from datetime import date, datetime, timedelta
from datetime import datetime, timedelta
[message trimmed]