From ccb3f13d69f0820d433309513c862280d4432e13 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 12 Apr 2014 12:44:29 -0500 Subject: [PATCH] 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 --- git-remote-hg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-remote-hg b/git-remote-hg index fdc6a30..280866b 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -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