Mercurial > public > mercurial-scm > hg
comparison mercurial/manifest.py @ 44703:0e99b876966a
manifest: teach treemanifest about long hashes
Differential Revision: https://phab.mercurial-scm.org/D8369
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 02 Apr 2020 15:52:10 -0400 |
parents | ecbba7b2e444 |
children | 0415a566742a |
comparison
equal
deleted
inserted
replaced
44702:0b0e72b5d551 | 44703:0e99b876966a |
---|---|
1025 self._loadlazy(dir) | 1025 self._loadlazy(dir) |
1026 if dir not in self._dirs: | 1026 if dir not in self._dirs: |
1027 self._dirs[dir] = treemanifest(self._subpath(dir)) | 1027 self._dirs[dir] = treemanifest(self._subpath(dir)) |
1028 self._dirs[dir].__setitem__(subpath, n) | 1028 self._dirs[dir].__setitem__(subpath, n) |
1029 else: | 1029 else: |
1030 self._files[f] = n[:21] # to match manifestdict's behavior | 1030 # manifest nodes are either 20 bytes or 32 bytes, |
1031 # depending on the hash in use. An extra byte is | |
1032 # occasionally used by hg, but won't ever be | |
1033 # persisted. Trim to 21 or 33 bytes as appropriate. | |
1034 trim = 21 if len(n) < 25 else 33 | |
1035 self._files[f] = n[:trim] # to match manifestdict's behavior | |
1031 self._dirty = True | 1036 self._dirty = True |
1032 | 1037 |
1033 def _load(self): | 1038 def _load(self): |
1034 if self._loadfunc is not _noop: | 1039 if self._loadfunc is not _noop: |
1035 lf, self._loadfunc = self._loadfunc, _noop | 1040 lf, self._loadfunc = self._loadfunc, _noop |