Commits

Pierre-Yves David  committed 62f2fe2

Use dedicated mechanism to report pushkey success

  • Participants
  • Parent commits 27f9c0d
  • Branches default

Comments (0)

Files changed (1)

File hgext/states.py

     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()
 
             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())