
101 Cal.App.3d 616 (1980)
161 Cal. Rptr. 686
THE PEOPLE, Plaintiff and Respondent,
v.
ROBERT AUGUST WELGE, Defendant and Appellant.
Docket No. 10686.
Court of Appeals of California, Fourth District, Division Two.
January 30, 1980.
*618 COUNSEL
Charles L. McKinstry, under appointment by the Court of Appeal, Quin Denvir, State Public Defender, and Mark E. Cutler, Deputy State Public Defender, for Defendant and Appellant.
*619 George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Daniel J. Kremer, Assistant Attorney General, Jay M. Bloom and Alan S. Meth, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
MORRIS, J.
Defendant appeals from the judgment below specifically on the ground that his sentence was improperly enhanced based on two prior felony convictions.

STATEMENT OF THE CASE
Pursuant to a plea bargain, defendant pleaded guilty to a violation of Penal Code section 487 (grand theft, a felony). He also admitted two prior convictions as charged in the amended complaint. Three other alleged priors were dismissed as a part of the plea bargain.
The court sentenced defendant to the middle base term of two years on the grand theft charge and added two one-year enhancements based on the two prior felonies.
Defendant appeals on the ground that the enhancements were not proper. He argues: (1) the prior prison terms used to enhance his sentence were not "completed" pursuant to Penal Code section 667.5, subdivision (g);[1] (2) one of the prior prison terms was not served in state prison as required by section 667.5, subdivision (e); and (3) the record does not show any allegation that the two prior prison terms were separately served.

DISCUSSION
(1) Defendant was charged with grand theft (§ 487), a nonviolent felony. Section 667.5, subdivision (b) governs nonviolent felonies and imposes a one-year enhancement "for each prior separate prison term served for any felony."
*620 Defendant entered a guilty plea, admitting two prior convictions as alleged in the amended complaint. The first was a conviction for burglary in May 1976. The second was a federal conviction in September of 1968 for entering the automobile of another with intent to steal.

1. "Completed" Prior Terms

Section 667.5, subdivision (g) defines a prior separate prison term for purposes of section 667.5, subdivision (b): "A prior separate prison term for the purposes of this section shall mean a continuous completed period of prison incarceration imposed for the particular offense alone or in combination with concurrent or consecutive sentences for other crimes, including any reimprisonment on revocation of parole which is not accompanied by a new commitment to prison, and including any reimprisonment after escape from such incarceration." (Italics added.)
Defendant states that, at the time the current offense was committed, he was out on parole on both prior offenses. After the commission of the new offense, his parole was revoked and he was reincarcerated on revocation of parole. Defendant argues that, since he was still incarcerated for revocation of parole at the time judgment was pronounced on the new offense, the two prior terms were not "completed."
Defendant's argument falls squarely into this court's holding in People v. Espinoza (1979) 99 Cal. App.3d 59 [159 Cal. Rptr. 894].
"[Defendant's] position is in essence that because his parole was revoked and he was recommitted to prison for an additional term upon revocation of parole, he is still serving the sentence imposed upon his prior ... convictions and thus, has not `completed' service of his prior prison sentence. We cannot agree.
"In the first place, defendant's position is contrary to the express language of subdivision (g). Were the `including' language of subdivision (g) meant to have the effect for which defendant argues, there would have been no occasion for the Legislature to distinguish between a recommitment to prison upon revocation of parole accompanied by a new commitment and a reimprisonment on revocation of parole not accompanied by a new commitment. In either event, upon reimprisonment on revocation of parole service of the prior sentence would not have been completed and no one-year enhancement could be imposed. Obviously, *621 the Legislature took great pains to distinguish between the two situations, and its having done so must be given significance. The interpretation suggested by the People ... does that; defendant's construction does not.
".... .... .... ....
"The truth is that section 667.5 does not define `a continuous completed period of prison incarceration.' The best indication of what the Legislature meant by that expression is found, we believe, in section 3000 in which the Legislature speaks of the `expiration of a term of imprisonment' in contradistinction to release on parole and `completion of parole, or ... the end of the maximum statutory period of parole.' The language of section 3000 makes plain the legislative assumption that a term of imprisonment expires prior to release on parole. A term of imprisonment which has expired, has been `completed.' We conclude, therefore, that a term of imprisonment is `completed' at the expiration of the stated term notwithstanding the undoubted legal truism that additional imprisonment on revocation of parole is referable to and in legal theory a part of an original term and notwithstanding that for purposes of determining how many prior separate prison terms a convicted felon has suffered, reimprisonment upon revocation of parole not accompanied by a new commitment is `included' in the prior prison term." (People v. Espinoza, supra, 99 Cal. App.3d 59, 71-73.)
For the reasons stated above, and as more fully set forth in our opinion in Espinoza, we conclude that defendant's prior prison terms were "completed" within the meaning of section 667.5, subdivision (g).

2. Term in State Prison

(2a) Section 667.5, subdivision (e) provides: "The additional penalties provided for prior prison terms shall not be imposed for any felony for which the defendant did not serve a prior separate term in state prison." (Italics added.)
The second prior conviction admitted by defendant was a federal conviction. He argues that, since he did not serve a prior prison term for the federal offense "in state prison," that prior prison term cannot be used to enhance his sentence.
*622 Section 667.5, subdivision (e) cannot, however, be read in isolation. (3) It is fundamental that all parts of a statute must be given meaning and effect if at all possible. (People v. Gilbert (1969) 1 Cal.3d 475, 480 [82 Cal. Rptr. 724, 462 P.2d 580]; Black Panther Party v. Kehoe (1974) 42 Cal. App.3d 645, 651 [117 Cal. Rptr. 106]; see Merrill v. Department of Motor Vehicles (1969) 71 Cal.2d 907, 918 [80 Cal. Rptr. 89, 458 P.2d 33].) (2b) If the statute were read strictly literally, as defendant suggests, to permit enhancements only for prior terms served in state prison, and precluding terms served in federal prison, then other portions of the statute would be meaningless and of no effect.
For example section 667.5, subdivision (h) provides that, "[s]erving a prison term includes any confinement time in any state prison or federal penal institution as punishment for commission of an offense...." (Italics added.) It would be purposeless to have that provision in the statute if federal prison terms could not be used as enhancements. The clear objective of section 667.5, particularly in light of subdivisions (f), (h), and (i),[2] is to have commitments which are equivalent to prison terms in California, including prison commitments in other jurisdictions or commitments to certain facilities other than prison, suffice to serve as a basis to enhance a later sentence.
We must evaluate the language of section 667.5, subdivision (e), so as to give effect, if possible, to the clear purpose of the statute as a whole. As originally enacted in 1976 (Stats. 1976, ch. 1139, § 268, pp. 5138-5139), section 667.5, subdivision (e) read as follows: "The additional penalties provided for prior prison terms shall not be imposed for any felony for which the defendant did not serve a prior separate prison term which was at least one year in duration." In 1977, section 667.5, subdivision (e) was amended to its present form. (Stats. 1977, ch. 165, § 13, p. 645.)
*623 The amendment eliminates the possibility, present under the old formulation, that a term of imprisonment in the county jail could be used as a basis for enhancing a subsequent felony conviction. We believe that the Legislature employed the words "in state prison" in contradistinction to the words of the former statute, which might have permitted a felony enhancement on the basis of a one-year term in the county jail. If the words "in state prison" in section 667.5, subdivision (e), are interpreted in this fashion, then no portion of the statute is rendered meaningless, and the entire statute can be construed consistently with the overall purpose of the legislation. The enhancement of defendant's sentence based on a prior federal prison term is proper.

3. Separate Prison Terms

(4) Finally, defendant argues that nothing in the record shows that his two prior prison terms were "separate" prison terms as required by the statute. He argues, therefore, that they must be construed to be concurrent terms, and hence, as only one prior term rather than two. The original complaint alleges the 1976 burglary conviction. The amendment to the complaint alleged four additional prior convictions, for each of which defendant was alleged to have "served a seperate [sic] prison term...." Defendant admitted the prior conviction alleged in the original complaint, as well as the 1968 federal conviction alleged in the amendment to the complaint.
Although a defendant who admits a charge of a prior conviction is held to have admitted only so great a charge as is contained in the information or complaint (see In re Tartar (1959) 52 Cal.2d 250, 256 [339 P.2d 553]), and although admission of prior convictions cannot be construed as an admission that separate terms were served therefor, in the absence of an allegation in the information or complaint that the defendant served separate terms on the prior convictions (People v. James (1978) 88 Cal. App.3d 150, 161-162 [151 Cal. Rptr. 354]; People v. Shaw (1965) 237 Cal. App.2d 606, 618 [47 Cal. Rptr. 96]), here we are not left with inferences or assumptions not supported by the record. In contrast to James, where there was no allegation that the priors were served separately, the amendment to the complaint specifically charged that defendant served separate prison terms for the additional alleged prior convictions. Defendant admitted the second prior, and in so doing admitted he served a separate term therefor. By admitting the second prior was separate from the first, the requirements of section 667.5, *624 subdivision (b), were satisfied. There is no evidence to show that defendant ever served any part of his federal sentence concurrently with his prior term for the 1976 burglary. Accordingly, the two enhancements are proper.

4. Plea Bargain

Finally, even though we have reviewed defendant's contentions on the merits, this case should not be decided without noting that defendant pleaded guilty to the grand theft charge and admitted two prior convictions as the result of a plea bargain. As a part of the bargain, the district attorney agreed to dismiss three other charged prior convictions. The record shows that defendant was fully aware of the consequences of admitting each prior conviction.
Defendant's criminal history was important to the People. Defendant clearly understood that his sentence would be increased because of the prior convictions. Yet, he freely and voluntarily entered a guilty plea. He should not now be permitted to change the bargain to his benefit.
"Well established is the rule that the People will be held strictly to the terms of a plea bargain made with a criminally accused. [Citations.] It seems reasonable and just, at least where no public policy, or statutory or decisional or constitutional principle otherwise directs, that the accused also be held to his agreement.
".... .... .... ....
"Here ... it may reasonably be said that [defendant's] attempted rejection of the agreement which induced the People's consent to his bargained for pleas and other advantages, is calculated to perpetrate a fraud upon the court and the People." (In re Troglin (1975) 51 Cal. App.3d 434, 438-439 [124 Cal. Rptr. 234].)
We can think of no reason of policy or principle why defendant should not be held to his agreement. Without it, the People would have had the opportunity to plead and prove all five prior convictions, had defendant been convicted and sentenced on the grand theft charge. Defendant freely and voluntarily admitted two prior convictions in return for dismissal of the other three. He ought not now to be permitted to retain the benefit of his bargain, yet challenge the two admitted priors.


*625 DISPOSITION
For the reasons stated above, we find that defendant's sentence was properly enhanced based on two prior felony convictions. The judgment is affirmed.
Gardner, P.J., and McDaniel, J., concurred.
Appellant's petition for a hearing by the Supreme Court was denied March 27, 1980.
NOTES
[1]  All statutory references are to the Penal Code, unless otherwise noted.
[2]  Section 667.5, subdivisions (f) and (i) read as follows: "(f) A prior conviction of a felony shall include a conviction in another jurisdiction for an offense which if committed in California is punishable by imprisonment in state prison provided the defendant served one year or more in prison for such offense in the other jurisdiction. A prior conviction of a particular felony shall include a conviction in another jurisdiction for an offense which includes all of the elements of the particular felony as defined under California law provided the defendant served one year or more in prison for such offense in the other jurisdiction."

"(i) For the purposes of this section, a commitment to the State Department of Health as a mentally disordered sex offender following a conviction of a felony, which commitment exceeds one year in duration, shall be deemed a prior prison term."
