171 raise error.Abort(_(b"too many flags specified.")) |
171 raise error.Abort(_(b"too many flags specified.")) |
172 # if --narrow is passed, it means they are includes and excludes for narrow |
172 # if --narrow is passed, it means they are includes and excludes for narrow |
173 # clone |
173 # clone |
174 if not narrow_pat and (include or exclude or enableprofile): |
174 if not narrow_pat and (include or exclude or enableprofile): |
175 |
175 |
176 def clonesparse(orig, self, node, overwrite, *args, **kwargs): |
176 def clonesparse(orig, ctx, *args, **kwargs): |
177 sparse.updateconfig( |
177 sparse.updateconfig( |
178 self.unfiltered(), |
178 ctx.repo().unfiltered(), |
179 pat, |
179 pat, |
180 {}, |
180 {}, |
181 include=include, |
181 include=include, |
182 exclude=exclude, |
182 exclude=exclude, |
183 enableprofile=enableprofile, |
183 enableprofile=enableprofile, |
184 usereporootpaths=True, |
184 usereporootpaths=True, |
185 ) |
185 ) |
186 return orig(self, node, overwrite, *args, **kwargs) |
186 return orig(ctx, *args, **kwargs) |
187 |
187 |
188 extensions.wrapfunction(hg, b'updaterepo', clonesparse) |
188 extensions.wrapfunction(mergemod, b'update', clonesparse) |
189 return orig(ui, repo, *args, **opts) |
189 return orig(ui, repo, *args, **opts) |
190 |
190 |
191 |
191 |
192 def _setupclone(ui): |
192 def _setupclone(ui): |
193 entry = commands.table[b'clone'] |
193 entry = commands.table[b'clone'] |