Show More
@@ -600,38 +600,41 b' def _updateconfigandrefreshwdir(' | |||||
600 | repo, includes, excludes, profiles, force=False, removing=False |
|
600 | repo, includes, excludes, profiles, force=False, removing=False | |
601 | ): |
|
601 | ): | |
602 | """Update the sparse config and working directory state.""" |
|
602 | """Update the sparse config and working directory state.""" | |
603 | raw = repo.vfs.tryread(b'sparse') |
|
603 | with repo.lock(): | |
604 | oldincludes, oldexcludes, oldprofiles = parseconfig(repo.ui, raw, b'sparse') |
|
604 | raw = repo.vfs.tryread(b'sparse') | |
605 |
|
605 | oldincludes, oldexcludes, oldprofiles = parseconfig( | ||
606 | oldstatus = repo.status() |
|
606 | repo.ui, raw, b'sparse' | |
607 | oldmatch = matcher(repo) |
|
607 | ) | |
608 | oldrequires = set(repo.requirements) |
|
|||
609 |
|
608 | |||
610 | # TODO remove this try..except once the matcher integrates better |
|
609 | oldstatus = repo.status() | |
611 | # with dirstate. We currently have to write the updated config |
|
610 | oldmatch = matcher(repo) | |
612 | # because that will invalidate the matcher cache and force a |
|
611 | oldrequires = set(repo.requirements) | |
613 | # re-read. We ideally want to update the cached matcher on the |
|
612 | ||
614 | # repo instance then flush the new config to disk once wdir is |
|
613 | # TODO remove this try..except once the matcher integrates better | |
615 | # updated. But this requires massive rework to matcher() and its |
|
614 | # with dirstate. We currently have to write the updated config | |
616 | # consumers. |
|
615 | # because that will invalidate the matcher cache and force a | |
|
616 | # re-read. We ideally want to update the cached matcher on the | |||
|
617 | # repo instance then flush the new config to disk once wdir is | |||
|
618 | # updated. But this requires massive rework to matcher() and its | |||
|
619 | # consumers. | |||
617 |
|
620 | |||
618 | if requirements.SPARSE_REQUIREMENT in oldrequires and removing: |
|
621 | if requirements.SPARSE_REQUIREMENT in oldrequires and removing: | |
619 | repo.requirements.discard(requirements.SPARSE_REQUIREMENT) |
|
622 | repo.requirements.discard(requirements.SPARSE_REQUIREMENT) | |
620 | scmutil.writereporequirements(repo) |
|
623 | scmutil.writereporequirements(repo) | |
621 | elif requirements.SPARSE_REQUIREMENT not in oldrequires: |
|
624 | elif requirements.SPARSE_REQUIREMENT not in oldrequires: | |
622 | repo.requirements.add(requirements.SPARSE_REQUIREMENT) |
|
625 | repo.requirements.add(requirements.SPARSE_REQUIREMENT) | |
623 | scmutil.writereporequirements(repo) |
|
626 | scmutil.writereporequirements(repo) | |
624 |
|
627 | |||
625 | try: |
|
628 | try: | |
626 | writeconfig(repo, includes, excludes, profiles) |
|
629 | writeconfig(repo, includes, excludes, profiles) | |
627 | return refreshwdir(repo, oldstatus, oldmatch, force=force) |
|
630 | return refreshwdir(repo, oldstatus, oldmatch, force=force) | |
628 | except Exception: |
|
631 | except Exception: | |
629 | if repo.requirements != oldrequires: |
|
632 | if repo.requirements != oldrequires: | |
630 | repo.requirements.clear() |
|
633 | repo.requirements.clear() | |
631 | repo.requirements |= oldrequires |
|
634 | repo.requirements |= oldrequires | |
632 | scmutil.writereporequirements(repo) |
|
635 | scmutil.writereporequirements(repo) | |
633 | writeconfig(repo, oldincludes, oldexcludes, oldprofiles) |
|
636 | writeconfig(repo, oldincludes, oldexcludes, oldprofiles) | |
634 | raise |
|
637 | raise | |
635 |
|
638 | |||
636 |
|
639 | |||
637 | def clearrules(repo, force=False): |
|
640 | def clearrules(repo, force=False): |
General Comments 0
You need to be logged in to leave comments.
Login now