Properly detect missing contexts

This can happen when there's a synchronization issue between marks-git
and marks-hg; a key is missing in marks-hg, and when we receive a reset
command the value of ctx basically comes from None.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2014-04-12 12:44:29 -05:00
parent 2958556bec
commit ccb3f13d69

View File

@@ -914,6 +914,11 @@ def checkheads_bmark(repo, ref, ctx):
ctx_old = bmarks[bmark]
ctx_new = ctx
if not ctx.rev():
print "error %s unknown" % ref
return False
if not repo.changelog.descendant(ctx_old.rev(), ctx_new.rev()):
if force_push:
print "ok %s forced update" % ref