We extend the classical existence and uniqueness theory of Jenkins-Serrin $(H=0)$ and Spruck $(H>0)$ for the constant mean curvature equation over a domain in $R^2$, to domains in $H^2$ or $S^2$. This theory allows prescribed boundary data including plus or minus infinity on entire arcs of the boundary. Necessarily these arc must have curvature $+2H$ or $-2H$ with respect to the domain. We give necessary and sufficient conditions for existence in terms of so called admissible polygons. The key idea, as in previous proofs, is to study the "flux" of monotone increasing and decreasing sequences of solutions.