D4532: narrow: set opts['narrow'] instead of local variable
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Wed Sep 12 08:31:56 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4afd2af36456: narrow: set opts['narrow'] instead of local variable (authored by indygreg, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4532?vs=10909&id=10922
REVISION DETAIL
https://phab.mercurial-scm.org/D4532
AFFECTED FILES
hgext/narrow/narrowcommands.py
CHANGE DETAILS
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -66,7 +66,6 @@
"""Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
opts = pycompat.byteskwargs(opts)
wrappedextraprepare = util.nullcontextmanager()
- opts_narrow = opts['narrow']
narrowspecfile = opts['narrowspec']
if narrowspecfile:
@@ -87,11 +86,11 @@
narrowspec.validatepatterns(excludes)
# narrowspec is passed so we should assume that user wants narrow clone
- opts_narrow = True
+ opts['narrow'] = True
opts['include'].extend(includes)
opts['exclude'].extend(excludes)
- if opts_narrow:
+ if opts['narrow']:
def pullbundle2extraprepare_widen(orig, pullop, kwargs):
# Create narrow spec patterns from clone flags
includepats = narrowspec.parsepatterns(opts['include'])
@@ -114,7 +113,7 @@
'_pullbundle2extraprepare', pullbundle2extraprepare_widen)
def pullnarrow(orig, repo, *args, **kwargs):
- if opts_narrow:
+ if opts['narrow']:
repo.requirements.add(repository.NARROW_REQUIREMENT)
repo._writerequirements()
To: indygreg, durin42, #hg-reviewers, pulkit
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list