# HG changeset patch # User Pierre-Yves David # Date 2014-10-10 21:43:04 # Node ID b078e4dc9f9abfcf30c001b60235cdc53e447920 # Parent fd759142c6e5487c0f8d65847c9f29f35969c66c obsstore: add a flag for sha256 hashes We add flag to inform that the marker is using sha256 hashes. As format 0 is not able to handle sha256 hashes (32 bytes long), we plain crash if we even attempt to encode a sha256 with it. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -112,6 +112,7 @@ from i18n import _ # bumped version and fix the situation, breaking the transitivity of # "bumped" here. bumpedfix = 1 +usingsha256 = 2 ## Parsing and writing of version "0" # @@ -193,6 +194,8 @@ def _fm0readmarkers(data, off=0): def _fm0encodeonemarker(marker): pre, sucs, flags, metadata, date, parents = marker + if flags & usingsha256: + raise util.Abort(_('cannot handle sha256 with old obsstore format')) metadata = dict(metadata) metadata['date'] = '%d %i' % date if parents is not None: