# HG changeset patch # User Bryan O'Sullivan # Date 2012-05-08 21:48:44 # Node ID 8f79aabd96f6de4c10cf8996b803fd8319fc74a9 # Parent 96fa9dd1db38fe6b241554423d42fd93d1a4be6b parsers: allow nt_find to signal an ambiguous match diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -544,6 +544,13 @@ static inline int nt_level(const char *n return v & 0xf; } +/* + * Return values: + * + * -4: match is ambiguous (multiple candidates) + * -2: not found + * rest: valid rev + */ static int nt_find(indexObject *self, const char *node, Py_ssize_t nodelen) { int level, off; @@ -572,7 +579,8 @@ static int nt_find(indexObject *self, co return -2; off = v; } - return -2; + /* multiple matches against an ambiguous prefix */ + return -4; } static int nt_new(indexObject *self)