debugsparse: abort if the repository is not sparse instead of ui.status()
authorPulkit Goyal <pulkit@yandex-team.ru>
Mon, 18 Mar 2019 14:48:49 +0300
changeset 41988 f9344d04909e
parent 41987 c1d83d916e85
child 41989 3e7cfa17df5d
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
hgext/sparse.py
--- 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,