Patchwork match: use ProgrammingError where appropriate

login
register
mail settings
Submitter via Mercurial-devel
Date May 23, 2017, 9:35 p.m.
Message ID <0af6e4aeb7937a7f8c04.1495575312@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20872/
State Accepted
Headers show

Comments

via Mercurial-devel - May 23, 2017, 9:35 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1495554541 25200
#      Tue May 23 08:49:01 2017 -0700
# Node ID 0af6e4aeb7937a7f8c04be30c37ab92f4dc1c385
# Parent  34e9b8b94f66db7ebe366f67cea7b64bd0ec6968
match: use ProgrammingError where appropriate
Yuya Nishihara - May 24, 2017, 1:18 p.m.
On Tue, 23 May 2017 14:35:12 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1495554541 25200
> #      Tue May 23 08:49:01 2017 -0700
> # Node ID 0af6e4aeb7937a7f8c04be30c37ab92f4dc1c385
> # Parent  34e9b8b94f66db7ebe366f67cea7b64bd0ec6968
> match: use ProgrammingError where appropriate

Queued, thanks.

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -38,7 +38,8 @@ 
     for kind, pat, source in kindpats:
         if kind == 'set':
             if not ctx:
-                raise error.Abort(_("fileset expression with no context"))
+                raise error.ProgrammingError("fileset expression with no "
+                                             "context")
             s = ctx.getfileset(pat)
             fset.update(s)
 
@@ -121,8 +122,8 @@ 
     normalize = _donormalize
     if icasefs:
         if exact:
-            raise error.Abort(_("a case-insensitive exact matcher doesn't "
-                                "make sense"))
+            raise error.ProgrammingError("a case-insensitive exact matcher "
+                                         "doesn't make sense")
         dirstate = ctx.repo().dirstate
         dsnormalize = dirstate.normalize