Mercurial > public > mercurial-scm > hg
comparison mercurial/changegroup.py @ 38835:a232e6744ba3
narrow: move requirement constant from changegroup to repository
As suggested by Gregory Szorc.
Differential Revision: https://phab.mercurial-scm.org/D4094
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 03 Aug 2018 11:02:34 -0700 |
parents | 5742d0428ed9 |
children | ee1ea96cf9c9 |
comparison
equal
deleted
inserted
replaced
38834:c83ad57627ae | 38835:a232e6744ba3 |
---|---|
24 manifest, | 24 manifest, |
25 match as matchmod, | 25 match as matchmod, |
26 mdiff, | 26 mdiff, |
27 phases, | 27 phases, |
28 pycompat, | 28 pycompat, |
29 repository, | |
29 util, | 30 util, |
30 ) | 31 ) |
31 | 32 |
32 from .utils import ( | 33 from .utils import ( |
33 stringutil, | 34 stringutil, |
36 _CHANGEGROUPV1_DELTA_HEADER = "20s20s20s20s" | 37 _CHANGEGROUPV1_DELTA_HEADER = "20s20s20s20s" |
37 _CHANGEGROUPV2_DELTA_HEADER = "20s20s20s20s20s" | 38 _CHANGEGROUPV2_DELTA_HEADER = "20s20s20s20s20s" |
38 _CHANGEGROUPV3_DELTA_HEADER = ">20s20s20s20s20sH" | 39 _CHANGEGROUPV3_DELTA_HEADER = ">20s20s20s20s20sH" |
39 | 40 |
40 LFS_REQUIREMENT = 'lfs' | 41 LFS_REQUIREMENT = 'lfs' |
41 | |
42 # When narrowing is finalized and no longer subject to format changes, | |
43 # we should move this to just "narrow" or similar. | |
44 NARROW_REQUIREMENT = 'narrowhg-experimental' | |
45 | 42 |
46 readexactly = util.readexactly | 43 readexactly = util.readexactly |
47 | 44 |
48 def getchunk(stream): | 45 def getchunk(stream): |
49 """return the next chunk from stream as a string""" | 46 """return the next chunk from stream as a string""" |
912 # the fly. Since tree manifests are hashed differently, all of history | 909 # the fly. Since tree manifests are hashed differently, all of history |
913 # would have to be converted. Instead, we simply don't even pretend to | 910 # would have to be converted. Instead, we simply don't even pretend to |
914 # support versions 01 and 02. | 911 # support versions 01 and 02. |
915 versions.discard('01') | 912 versions.discard('01') |
916 versions.discard('02') | 913 versions.discard('02') |
917 if NARROW_REQUIREMENT in repo.requirements: | 914 if repository.NARROW_REQUIREMENT in repo.requirements: |
918 # Versions 01 and 02 don't support revlog flags, and we need to | 915 # Versions 01 and 02 don't support revlog flags, and we need to |
919 # support that for stripping and unbundling to work. | 916 # support that for stripping and unbundling to work. |
920 versions.discard('01') | 917 versions.discard('01') |
921 versions.discard('02') | 918 versions.discard('02') |
922 if LFS_REQUIREMENT in repo.requirements: | 919 if LFS_REQUIREMENT in repo.requirements: |