Mercurial > public > mercurial-scm > hg-stable
diff mercurial/obsolete.py @ 22177:a56038e6a3c9 stable
obsstore.create: add a simple safeguard against cyclic markers
We detect when there is a cycle in the marker itself (precursors being listed
as successors).
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 14 Aug 2014 14:59:42 -0700 |
parents | bf2891877378 |
children | 8dda6f6ff564 |
line wrap: on
line diff
--- a/mercurial/obsolete.py Thu Aug 14 14:57:03 2014 -0700 +++ b/mercurial/obsolete.py Thu Aug 14 14:59:42 2014 -0700 @@ -277,6 +277,8 @@ for succ in succs: if len(succ) != 20: raise ValueError(succ) + if prec in succs: + raise ValueError(_('in-marker cycle with %s') % node.hex(prec)) marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata)) return bool(self.add(transaction, [marker]))