diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -1026,7 +1026,8 @@ self._dirs[dir] = treemanifest(self._subpath(dir)) self._dirs[dir].__setitem__(subpath, n) else: - self._files[f] = n[:21] # to match manifestdict's behavior + trim = 21 if len(n) < 25 else 33 + self._files[f] = n[:trim] # to match manifestdict's behavior self._dirty = True def _load(self):