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
--- 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,