[PATCH 4/8] remote-hg: properly detect missing contexts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 git-remote-hg.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/git-remote-hg.py b/git-remote-hg.py
index 8aca6dd..1972f7f 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
-- 
1.9.2+fc1.3.gade8541

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]