Patchwork D6149: debugsparse: abort if the repository is not sparse instead of ui.status()

login
register
mail settings
Submitter phabricator
Date March 18, 2019, 2:27 p.m.
Message ID <differential-rev-PHID-DREV-qgtweghkuiz56rv6nqsk-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39319/
State Superseded
Headers show

Comments

phabricator - March 18, 2019, 2:27 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is similar to what narrow extension does.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/sparse.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -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,