When the old position of a bookmark have successors unknown of the local repo, the exchange (push or pull) crash on a key error (for the unknown node). The error is raise by validdest. This is cause by "%ln" revset expecting all node to exist locally
This could be easily solved by adding a `succs.intersection_update(known)` step in the function with known being the set of nodes in the repo. however the `know` set can't be easily built using `known = set(repo.changelog.nodemap)` because `nodemap` is actually a C `index` object. Iteration over such object yield full index entry, not just node. The quick and dirty approach is: if util.safehasattr(nm, 'nodemap'): # node map is C version of the index known = set(entry[7] for entry in nm) else: known = set(nm) The other one would be to add a `keys()` method on `index` object (and use it to build the set)
I noticed this on my for-mpm repo but didn't have time to diagnose. It's pretty annoying.
Fixed by http://selenic.com/repo/hg/rev/daf32ebfde6b Pierre-Yves David <pierre-yves.david@logilab.fr> bookmark: prevent crashing when a successor is unknown locally (issue3680) The `%ln` revset substitution does not accept unknown node. We prune unknown node from potential successors before computing descendants. This have no impact on the result of this function. - Descendants of unknown changeset as unknown, - all successors of unknown changesets are already return by the call who returned those same unknown changesets, - unknown changesets are never a valid destination for a bookmark. (please test the fix)