changeset 41988:f9344d04909e

debugsparse: abort if the repository is not sparse instead of ui.status() This is similar to what narrow extension does. Differential Revision: https://phab.mercurial-scm.org/D6149
author Pulkit Goyal <pulkit@yandex-team.ru>
date Mon, 18 Mar 2019 14:48:49 +0300
parents c1d83d916e85
children 3e7cfa17df5d
files hgext/sparse.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/sparse.py	Tue Mar 12 14:17:41 2019 -0700
+++ b/hgext/sparse.py	Mon Mar 18 14:48:49 2019 +0300
@@ -318,9 +318,10 @@
             if temporaryincludes:
                 ui.status(_("Temporarily Included Files (for merge/rebase):\n"))
                 ui.status(("\n".join(temporaryincludes) + "\n"))
+            return
         else:
-            ui.status(_('repo is not sparse\n'))
-        return
+            raise error.Abort(_('the debugsparse command is only supported on'
+                                ' sparse repositories'))
 
     if include or exclude or delete or reset or enableprofile or disableprofile:
         sparse.updateconfig(repo, pats, opts, include=include, exclude=exclude,