martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is the usual way of doing it and I don't see a reason to do it
  differently here.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py
  tests/test-narrow-trackedcmd.t

CHANGE DETAILS

diff --git a/tests/test-narrow-trackedcmd.t b/tests/test-narrow-trackedcmd.t
--- a/tests/test-narrow-trackedcmd.t
+++ b/tests/test-narrow-trackedcmd.t
@@ -196,8 +196,8 @@
   X path:widest
 
   $ hg tracked --import-rules specs --clear
-  The --clear option is not yet supported.
-  [1]
+  abort: the --clear option is not yet supported
+  [255]
 
 Testing with passing a out of wdir file
 
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -368,15 +368,13 @@
     """
     opts = pycompat.byteskwargs(opts)
     if repository.NARROW_REQUIREMENT not in repo.requirements:
-        ui.warn(_('The narrow command is only supported on respositories 
cloned'
-                  ' with --narrow.\n'))
-        return 1
+        raise error.Abort(_('the narrow command is only supported on '
+                            'respositories cloned with --narrow'))
 
     # Before supporting, decide whether it "hg tracked --clear" should mean
     # tracking no paths or all paths.
     if opts['clear']:
-        ui.warn(_('The --clear option is not yet supported.\n'))
-        return 1
+        raise error.Abort(_('the --clear option is not yet supported'))
 
     # import rules from a file
     newrules = opts.get('import_rules')



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to