Also document why we need cg3 or higher.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Also document why we need cg3 or higher.
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/narrow/narrowchangegroup.py (10 lines) | |||
| M | mercurial/changegroup.py (5 lines) |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | D2491 narrow: always wrap repo | |
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| mdiff, | mdiff, | ||||
| node, | node, | ||||
| revlog, | revlog, | ||||
| util, | util, | ||||
| ) | ) | ||||
| def setup(): | def setup(): | ||||
| def supportedoutgoingversions(orig, repo): | |||||
| versions = orig(repo) | |||||
| if changegroup.NARROW_REQUIREMENT in repo.requirements: | |||||
| versions.discard('01') | |||||
| versions.discard('02') | |||||
| return versions | |||||
| extensions.wrapfunction(changegroup, 'supportedoutgoingversions', | |||||
| supportedoutgoingversions) | |||||
| def prune(orig, self, revlog, missing, commonrevs): | def prune(orig, self, revlog, missing, commonrevs): | ||||
| if isinstance(revlog, manifest.manifestrevlog): | if isinstance(revlog, manifest.manifestrevlog): | ||||
| matcher = getattr(self._repo, 'narrowmatch', | matcher = getattr(self._repo, 'narrowmatch', | ||||
| getattr(self, '_narrow_matcher', None)) | getattr(self, '_narrow_matcher', None)) | ||||
| if (matcher is not None and | if (matcher is not None and | ||||
| not matcher().visitdir(revlog._dir[:-1] or '.')): | not matcher().visitdir(revlog._dir[:-1] or '.')): | ||||
| return [] | return [] | ||||
| return orig(self, revlog, missing, commonrevs) | return orig(self, revlog, missing, commonrevs) | ||||
| if 'treemanifest' in repo.requirements: | if 'treemanifest' in repo.requirements: | ||||
| # Versions 01 and 02 support only flat manifests and it's just too | # Versions 01 and 02 support only flat manifests and it's just too | ||||
| # expensive to convert between the flat manifest and tree manifest on | # expensive to convert between the flat manifest and tree manifest on | ||||
| # the fly. Since tree manifests are hashed differently, all of history | # the fly. Since tree manifests are hashed differently, all of history | ||||
| # would have to be converted. Instead, we simply don't even pretend to | # would have to be converted. Instead, we simply don't even pretend to | ||||
| # support versions 01 and 02. | # support versions 01 and 02. | ||||
| versions.discard('01') | versions.discard('01') | ||||
| versions.discard('02') | versions.discard('02') | ||||
| if NARROW_REQUIREMENT in repo.requirements: | |||||
| # Versions 01 and 02 don't support revlog flags, and we need to | |||||
| # support that for stripping and unbundling to work. | |||||
| versions.discard('01') | |||||
| versions.discard('02') | |||||
| return versions | return versions | ||||
| def localversion(repo): | def localversion(repo): | ||||
| # Finds the best version to use for bundles that are meant to be used | # Finds the best version to use for bundles that are meant to be used | ||||
| # locally, such as those from strip and shelve, and temporary bundles. | # locally, such as those from strip and shelve, and temporary bundles. | ||||
| return max(supportedoutgoingversions(repo)) | return max(supportedoutgoingversions(repo)) | ||||
| def safeversion(repo): | def safeversion(repo): | ||||