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

REVISION SUMMARY
  This will be used for parsing a file that's stored in a different
  location.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/narrowspec.py

CHANGE DETAILS

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -127,6 +127,18 @@
     return matchmod.match(root, '', [], include=include or [],
                           exclude=exclude or [])
 
+def parseconfig(ui, spec):
+    # maybe we should care about the profiles returned too
+    includepats, excludepats, profiles = sparse.parseconfig(ui, spec, 'narrow')
+    if profiles:
+        raise error.Abort(_("including other spec files using '%include' is 
not"
+                            " supported in narrowspec"))
+
+    validatepatterns(includepats)
+    validatepatterns(excludepats)
+
+    return includepats, excludepats
+
 def load(repo):
     try:
         spec = repo.svfs.read(FILENAME)
@@ -136,17 +148,8 @@
         if e.errno == errno.ENOENT:
             return set(), set()
         raise
-    # maybe we should care about the profiles returned too
-    includepats, excludepats, profiles = sparse.parseconfig(repo.ui, spec,
-                                                            'narrow')
-    if profiles:
-        raise error.Abort(_("including other spec files using '%include' is 
not"
-                            " supported in narrowspec"))
 
-    validatepatterns(includepats)
-    validatepatterns(excludepats)
-
-    return includepats, excludepats
+    return parseconfig(repo.ui, spec)
 
 def save(repo, includepats, excludepats):
     validatepatterns(includepats)



To: martinvonz, #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