Patchwork D9312: errors: raise more specific errors when default remote not configured

login
register
mail settings
Submitter phabricator
Date Nov. 12, 2020, 4:39 p.m.
Message ID <differential-rev-PHID-DREV-qbp4zis7s7y6wgfjbthe-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47586/
State Superseded
Headers show

Comments

phabricator - Nov. 12, 2020, 4:39 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9312

AFFECTED FILES
  mercurial/commands.py
  tests/test-default-push.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-default-push.t b/tests/test-default-push.t
--- a/tests/test-default-push.t
+++ b/tests/test-default-push.t
@@ -20,7 +20,7 @@ 
   $ hg push --config paths.default=
   abort: default repository not configured!
   (see 'hg help config.paths')
-  [255]
+  [30]
 
   $ cd ..
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4903,7 +4903,7 @@ 
     # style URLs, so don't overwrite dest.
     path = ui.paths.getpath(dest, default=(b'default-push', b'default'))
     if not path:
-        raise error.Abort(
+        raise error.ConfigError(
             _(b'default repository not configured!'),
             hint=_(b"see 'hg help config.paths'"),
         )
@@ -5524,7 +5524,7 @@ 
 
     path = ui.paths.getpath(dest, default=(b'default-push', b'default'))
     if not path:
-        raise error.Abort(
+        raise error.ConfigError(
             _(b'default repository not configured!'),
             hint=_(b"see 'hg help config.paths'"),
         )