Patchwork [follow-up] perftemplating: abort on incompatible version

login
register
mail settings
Submitter Boris Feld
Date June 12, 2018, 7:42 a.m.
Message ID <1d1ccc0388cd266b6186.1528789362@FB-lair>
Download mbox | patch
Permalink /patch/32069/
State Accepted
Headers show

Comments

Boris Feld - June 12, 2018, 7:42 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1528736741 -7200
#      Mon Jun 11 19:05:41 2018 +0200
# Node ID 1d1ccc0388cd266b6186be64dafbc46015440fa0
# Parent  a577a199983c5033192660c55db909df83fe65fc
# EXP-Topic perftemplating
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1d1ccc0388cd
perftemplating: abort on incompatible version

This is what the other debug commands do. Thanks to Yuya Nishihara for
pointing this out.
Yuya Nishihara - June 12, 2018, 11:42 a.m.
On Tue, 12 Jun 2018 09:42:42 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1528736741 -7200
> #      Mon Jun 11 19:05:41 2018 +0200
> # Node ID 1d1ccc0388cd266b6186be64dafbc46015440fa0
> # Parent  a577a199983c5033192660c55db909df83fe65fc
> # EXP-Topic perftemplating
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1d1ccc0388cd
> perftemplating: abort on incompatible version

Queued, thanks.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -911,8 +911,8 @@  def perfmoonwalk(ui, repo, **opts):
          ] + formatteropts)
 def perftemplating(ui, repo, **opts):
     if makelogtemplater is None:
-        ui.write_err('incompatible Mercurial version')
-        return 1
+        raise error.Abort(("perftemplating not available with this Mercurial"),
+                          hint="use 4.3 or later")
 
     nullui = ui.copy()
     nullui.fout = open(os.devnull, 'wb')