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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Nov 12 16:39:39 UTC 2020


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

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'"),
         )



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


More information about the Mercurial-devel mailing list