Petitioner seek a writ of mandate to compel the respondent court to permit them to file a second amended complaint in an action on a contract.
On September 21, 1960, petitioners and the real parties in *285 interest entered into a contract whereby petitioners were to act as the exclusive agent in the negotiation and procurement of long-term leases of commercial sites in Yuba Plaza Shopping Center, a new development under the ownership of the real parties in interest. Under the contract, payment for petitioners' performance was conditioned on the accrual of Yuba Plaza’s right to payment of the first rental payment under each of the leases and the procurement, whether by petitioners or not, of a construction loan and long-term loan to cover the on-site construction costs of the shopping center.
In July 1963 petitioners filed a complaint against Yuba Plaza et al., for the amount owing as a result of petitioners’ performance in negotiating certain long-term leases and obtaining a commitment for a long-term lease.
The superior court in January 1964 sustained defendants’ demurrer “without leave to amend until such time as the conditions precedent in the contract between the parties have occurred.” Petitioners made a motion to vacate this order and for leave to file a second amended complaint based on anticipatory breach (and as a second cause of action—for services rendered). Said proposed second amended complaint pleads the making of a contract between the petitioners and the aforementioned defendants (paragraph V); that the petitioners have performed all the conditions and all things to be done and performed up to the time of repudiation and were ready, willing and able to complete their performance (paragraph VI); that the defendants unequivocally repudiated this contract and wrongfully discharged petitioners from performance thereunder (paragraph VII) • and finally that subsequent to said repudiation the defendants have never retracted this repudiation (paragraph VIII); and that petitioners have been damaged (paragraph IX).
Petitioners’ motion was denied by the court and they seek a writ of mandamus from this court.
We must first consider whether mandamus is the proper remedy. Defendant Yuba Plaza states that the general rule is that to test the validity of an order sustaining a demurrer without leave to amend a judgment of dismissal should be entered and the plaintiff can then appeal from the judgment.
(Berri
v.
Superior Court,
In the instant case the argument of Yuba Plaza is based on the theory that the court’s order was simply an order sustaining a demurrer without leave to amend, but the order here is not a true order sustaining a demurrer without *286 leave to amend. Here, upon petitioners showing that the condition precedent had occurred, it appears that the court would permit petitioners to reinstate their claim. As such, it is not a final order but an interlocutory order which is neither final for purposes of appeal nor final in the trial court. (3 Within, Cal. Procedure, Judgment, § 3, pp. 1874-1875.)
Section 1086 of the Code of Civil Procedure provides that the writ of mandamus will issue “in all cases where there is not a plain, speedy, and adequate remedy, in the ordinary course of law.”
(Sharff
v.
Superior
Court,
Courts should indulge in great liberality in allowing amendments to a complaint in order that no litigant is deprived of his day in court because of mere technicalities of pleading.
(Saari
v.
Superior Court,
In the case at bench the petitioners are not attempting to introduce an entirely new cause by the proposed second amended complaint but merely propose a change of theory in their action against defendants. Petititioners ’ first amended complaint alleges a contract, full performance on their part, and a breach thereof in that upon demand defendants failed
*287
and refused to pay the money due them for their performance rendered pursuant to the contract. A plaintiff, however, cannot enforce the defendant’s obligation unless the plaintiff has performed the conditions precedent imposed upon him (Civ. Code, § 1439; see also Code Civ. Proc., § 457); accordingly, he must allege either performance of the conditions precedent
(Fenn
v.
Pickwick Corp.,
In pleading the repudiation of the contract by the defendants, petitioners have brought themselves within the well-recognized doctrine of anticipatory breach. In
Gold Mining & Water Co.
v.
Swinerton,
Petitioners have pleaded the necessary elements in their proposed second amended complaint. The effect of the pleaded repudiation was that the injured parties, Harry Daum and Daum Development Corporation, had an election of remedies: (a) they may have waited until the time for performance and then exercised their remedies for actual breach of contract; or (b) they had the election to treat the repudiation as an anticipatory breach and sue immediately. Petitioners chose the latter course. This remedy is commented on in
Atkinson
v.
District Bond Co.,
The petitioners in their proposed amended complaint have pleaded the necessary elements of repudiation to exercise this election of suing immediately. They have alleged that they had performed all of the conditions up to the time of the repudiation and were ready, able and willing to complete performance pursuant to the contract except for defendants’ *289 expressed unequivocal repudiation that has not been retracted, and that as a result of defendants’ repudiation, petitioners have suffered damages.
We are convinced that the denial of petitioners’ motion to file the proposed second amended complaint was an abuse of discretion, for as stated by this court in
Saari
v.
Superior Court, supra,
‘‘And finally, as said in the case of
Vick
v.
Grasser,
Furthermore, the order made by the court was really not an order sustaining the demurrer to the first amended complaint without leave to amend because it was made eondi *290 tional by the statement “until such time as conditions precedent in the contract between the parties have occurred. ’ ’ Such an order was in effect an order for the abatement of the action, and the court had no authority to make such an order. When petitioners sought permission to file the second amended complaint, as hereinbefore set forth, the court should have granted the motion. Petitioners are entitled to a writ ordering the court to permit the filing of the said proposed second amended complaint. Further proceedings are to be in accordance with the views herein expressed.
Let a peremptory writ issue as prayed for.
Pierce, P. J., and Friedman, J., concurred.
