# HG changeset patch # User Pierre-Yves David # Date 1315559744 -7200 # Node ID 62f2fe22bd420c5be6f0e6d4aa13b9db7fa33be3 # Parent 27f9c0d0a996fc99981f749fcc3c5471d2e3b28a Use dedicated mechanism to report pushkey success diff -r 27f9c0d0a996 -r 62f2fe22bd42 hgext/states.py --- a/hgext/states.py Thu Sep 08 19:07:00 2011 +0200 +++ b/hgext/states.py Fri Sep 09 11:15:44 2011 +0200 @@ -183,8 +183,12 @@ w = repo.wlock() try: newhead = node.bin(key) - repo[newhead] + try: + repo[newhead] + except error.RepoLookupError: + return False repo.setstate(st, [newhead]) + return True finally: w.release() @@ -407,9 +411,8 @@ missing = local - set(remoteheads) while missing: h = missing.pop() - try: - remote.pushkey('states-heads', node.hex(h), '', state.name) - except error.RepoLookupError: + ok = remote.pushkey('states-heads', node.hex(h), '', state.name) + if not ok: missing.update(p.node() for p in repo[h].parents())