hgext/narrow/narrowcommands.py
changeset 39544 10a8472f6662
parent 39541 8301741e1f89
child 39545 4afd2af36456
--- a/hgext/narrow/narrowcommands.py	Fri Sep 07 18:35:54 2018 -0700
+++ b/hgext/narrow/narrowcommands.py	Tue Sep 11 15:53:12 2018 -0700
@@ -62,25 +62,6 @@
 
     extensions.wrapcommand(commands.table, 'archive', archivenarrowcmd)
 
-def expandpull(pullop, includepats, excludepats):
-    if not narrowspec.needsexpansion(includepats):
-        return includepats, excludepats
-
-    heads = pullop.heads or pullop.rheads
-    includepats, excludepats = pullop.remote.expandnarrow(
-        includepats, excludepats, heads)
-    pullop.repo.ui.debug('Expanded narrowspec to inc=%s, exc=%s\n' % (
-        includepats, excludepats))
-
-    includepats = set(includepats)
-    excludepats = set(excludepats)
-
-    # Nefarious remote could supply unsafe patterns. Validate them.
-    narrowspec.validatepatterns(includepats)
-    narrowspec.validatepatterns(excludepats)
-
-    return includepats, excludepats
-
 def clonenarrowcmd(orig, ui, repo, *args, **opts):
     """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
     opts = pycompat.byteskwargs(opts)
@@ -116,10 +97,6 @@
             includepats = narrowspec.parsepatterns(opts['include'])
             excludepats = narrowspec.parsepatterns(opts['exclude'])
 
-            # If necessary, ask the server to expand the narrowspec.
-            includepats, excludepats = expandpull(
-                pullop, includepats, excludepats)
-
             if not includepats and excludepats:
                 # If nothing was included, we assume the user meant to include
                 # everything, except what they asked to exclude.
@@ -292,10 +269,6 @@
 def _widen(ui, repo, remote, commoninc, newincludes, newexcludes):
     newmatch = narrowspec.match(repo.root, newincludes, newexcludes)
 
-    # TODO(martinvonz): Get expansion working with widening/narrowing.
-    if narrowspec.needsexpansion(newincludes):
-        raise error.Abort('Expansion not yet supported on pull')
-
     def pullbundle2extraprepare_widen(orig, pullop, kwargs):
         orig(pullop, kwargs)
         # The old{in,ex}cludepats have already been set by orig()
@@ -402,9 +375,6 @@
         opts['addinclude'].extend(includepats)
         opts['addexclude'].extend(excludepats)
 
-    if narrowspec.needsexpansion(opts['addinclude'] + opts['addexclude']):
-        raise error.Abort('Expansion not yet supported on widen/narrow')
-
     addedincludes = narrowspec.parsepatterns(opts['addinclude'])
     removedincludes = narrowspec.parsepatterns(opts['removeinclude'])
     addedexcludes = narrowspec.parsepatterns(opts['addexclude'])