##// END OF EJS Templates
narrow: set opts['narrow'] instead of local variable...
Gregory Szorc -
r39582:4afd2af3 default
parent child Browse files
Show More
@@ -66,7 +66,6 b' def clonenarrowcmd(orig, ui, repo, *args'
66 """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
66 """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
67 opts = pycompat.byteskwargs(opts)
67 opts = pycompat.byteskwargs(opts)
68 wrappedextraprepare = util.nullcontextmanager()
68 wrappedextraprepare = util.nullcontextmanager()
69 opts_narrow = opts['narrow']
70 narrowspecfile = opts['narrowspec']
69 narrowspecfile = opts['narrowspec']
71
70
72 if narrowspecfile:
71 if narrowspecfile:
@@ -87,11 +86,11 b' def clonenarrowcmd(orig, ui, repo, *args'
87 narrowspec.validatepatterns(excludes)
86 narrowspec.validatepatterns(excludes)
88
87
89 # narrowspec is passed so we should assume that user wants narrow clone
88 # narrowspec is passed so we should assume that user wants narrow clone
90 opts_narrow = True
89 opts['narrow'] = True
91 opts['include'].extend(includes)
90 opts['include'].extend(includes)
92 opts['exclude'].extend(excludes)
91 opts['exclude'].extend(excludes)
93
92
94 if opts_narrow:
93 if opts['narrow']:
95 def pullbundle2extraprepare_widen(orig, pullop, kwargs):
94 def pullbundle2extraprepare_widen(orig, pullop, kwargs):
96 # Create narrow spec patterns from clone flags
95 # Create narrow spec patterns from clone flags
97 includepats = narrowspec.parsepatterns(opts['include'])
96 includepats = narrowspec.parsepatterns(opts['include'])
@@ -114,7 +113,7 b' def clonenarrowcmd(orig, ui, repo, *args'
114 '_pullbundle2extraprepare', pullbundle2extraprepare_widen)
113 '_pullbundle2extraprepare', pullbundle2extraprepare_widen)
115
114
116 def pullnarrow(orig, repo, *args, **kwargs):
115 def pullnarrow(orig, repo, *args, **kwargs):
117 if opts_narrow:
116 if opts['narrow']:
118 repo.requirements.add(repository.NARROW_REQUIREMENT)
117 repo.requirements.add(repository.NARROW_REQUIREMENT)
119 repo._writerequirements()
118 repo._writerequirements()
120
119
General Comments 0
You need to be logged in to leave comments. Login now