diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2014-04-29 04:04:31 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-29 14:10:18 -0700 |
commit | f74bfa2cca2b242a74ccd5ceab383dc988548abd (patch) | |
tree | e9edb5483cf13bc99105abe0ca54e96d2e373b3d | |
parent | a473e579b434e45e864baf2eabf9e3b5baa92bfc (diff) | |
download | git-f74bfa2cca2b242a74ccd5ceab383dc988548abd.tar.gz |
remote-hg: 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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | git-remote-hg.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/git-remote-hg.py b/git-remote-hg.py index 8aca6ddd48..1972f7fc8b 100755 --- a/git-remote-hg.py +++ b/git-remote-hg.py @@ -917,6 +917,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 |