An appeal from a judgment on the trial of a writ of habeas corpus may be had by or in behalf of the person deprived of his liberty on the same terms and conditions as are provided for in criminal cases; but such appeal shall not entitle a party to be discharged on bail in any case held not to be one in which the party is entitled to bail. In all other cases, an appeal from a judgment on trial of a writ of habeas corpus may be had on their terms prescribed for appeals in civil cases, where a supersedeas is not desired.