Mercurial > hg
comparison hgext/narrow/narrowcommands.py @ 39965:1a4c1a3cc3f5
narrow: pass old includes and excludes to _widen()
In future patches we will need to pass them in the widen wireprotocol command
which we are building.
Differential Revision: https://phab.mercurial-scm.org/D4812
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Sun, 30 Sep 2018 18:45:16 +0300 |
parents | 06e75fbf9d6b |
children | 8feae5b989bc |
comparison
equal
deleted
inserted
replaced
39964:06e75fbf9d6b | 39965:1a4c1a3cc3f5 |
---|---|
246 newexcludes, oldmatch, newmatch) | 246 newexcludes, oldmatch, newmatch) |
247 repo.setnarrowpats(newincludes, newexcludes) | 247 repo.setnarrowpats(newincludes, newexcludes) |
248 | 248 |
249 repo.destroyed() | 249 repo.destroyed() |
250 | 250 |
251 def _widen(ui, repo, remote, commoninc, newincludes, newexcludes): | 251 def _widen(ui, repo, remote, commoninc, oldincludes, oldexcludes, |
252 newincludes, newexcludes): | |
252 newmatch = narrowspec.match(repo.root, newincludes, newexcludes) | 253 newmatch = narrowspec.match(repo.root, newincludes, newexcludes) |
253 | 254 |
254 # for now we assume that if a server has ellipses enabled, we will be | 255 # for now we assume that if a server has ellipses enabled, we will be |
255 # exchanging ellipses nodes. In future we should add ellipses as a client | 256 # exchanging ellipses nodes. In future we should add ellipses as a client |
256 # side requirement (maybe) to distinguish a client is shallow or not and | 257 # side requirement (maybe) to distinguish a client is shallow or not and |
431 oldexcludes = newexcludes | 432 oldexcludes = newexcludes |
432 | 433 |
433 if widening: | 434 if widening: |
434 newincludes = oldincludes | addedincludes | 435 newincludes = oldincludes | addedincludes |
435 newexcludes = oldexcludes - removedexcludes | 436 newexcludes = oldexcludes - removedexcludes |
436 _widen(ui, repo, remote, commoninc, newincludes, newexcludes) | 437 _widen(ui, repo, remote, commoninc, oldincludes, oldexcludes, |
438 newincludes, newexcludes) | |
437 | 439 |
438 return 0 | 440 return 0 |