Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 19326:7014526d67a8
revlog: add exception when linkrev == nullrev
When we deployed the latest crew mercurial to our users, a few of them
had issues where a filelog would have an entry with a -1 linkrev. This
caused operations like rebase and amend to create a bundle containing the
entire repository, which took a long time.
I don't know what the issue is, but adding this check should prevent repos
from getting in this state, and should help us pinpoint the issue next time
it happens.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 17 Jun 2013 19:44:00 -0700 |
parents | 4cfdec944edf |
children | fd1bb7c1be78 |
comparison
equal
deleted
inserted
replaced
19325:ec896f9e8894 | 19326:7014526d67a8 |
---|---|
989 transaction - the transaction object used for rollback | 989 transaction - the transaction object used for rollback |
990 link - the linkrev data to add | 990 link - the linkrev data to add |
991 p1, p2 - the parent nodeids of the revision | 991 p1, p2 - the parent nodeids of the revision |
992 cachedelta - an optional precomputed delta | 992 cachedelta - an optional precomputed delta |
993 """ | 993 """ |
994 if link == nullrev: | |
995 raise RevlogError(_("attempted to add linkrev -1 to %s") | |
996 % self.indexfile) | |
994 node = hash(text, p1, p2) | 997 node = hash(text, p1, p2) |
995 if node in self.nodemap: | 998 if node in self.nodemap: |
996 return node | 999 return node |
997 | 1000 |
998 dfh = None | 1001 dfh = None |