
84 Cal.App.3d 38 (1978)
148 Cal. Rptr. 276
In re GARY O., a Person Coming Under the Juvenile Court Law.
THE PEOPLE, Plaintiff and Respondent,
v.
GARY O., Defendant and Appellant.
In re GARY O., a Minor, on Habeas Corpus.
Docket Nos. 3707, 3682.
Court of Appeals of California, Fifth District.
August 18, 1978.
*39 COUNSEL
Paul N. Halvonik, State Public Defender, Gary S. Goodpaster, Chief Assistant State Public Defender, and Laurance S. Smith, Deputy State Public Defender, for Defendant and Appellant and for Petitioner.
Evelle J. Younger, Attorney General, Jack R. Winkler, Chief Assistant Attorney General, Arnold O. Overoye, Assistant Attorney General, Willard F. Jones, Garrick W. Chock, Eddie T. Keller, W. Scott Thorpe and James T. McNally, Deputy Attorneys General, for Plaintiff and Respondent.
*40 OPINION
FRANSON, J. 

STATEMENT OF THE CASE AND FACTS
Petitioner's appeal and habeas corpus petition have been consolidated for hearing. Since we reverse the judgment, the habeas corpus petition is rendered moot.
The pertinent facts are as follows: On September 9, 1977, a petition was filed in the Kern County Juvenile Court alleging that appellant, aged 17, came within Welfare and Institutions Code section 602. It was alleged in count I that appellant had violated Health and Safety Code section 11359 (possession of marijuana for sale), in count II that he violated Penal Code section 484 (petty theft of an electric drill valued at $30), and in count III that he violated Health and Safety Code section 11357, subdivision (c) (unlawful possession of more than one ounce of marijuana). At a detention hearing on September 13 appellant denied each count.
At a jurisdictional hearing on September 30 appellant indicated that he would admit the petty theft charge. The referee informed him that the district attorney had agreed to drop the other two counts if he admitted the petty theft. The referee also ascertained that appellant understood the nature of the charge and the constitutional rights he was relinquishing by admitting it. In addition, the court advised him that his admission of the theft charge could result in either probation or commitment to a local facility or the California Youth Authority (CYA). The court thereupon read him the charge, stating that the maximum confinement time for it was six months. The appellant admitted the petty theft. Counts I and III were then dismissed on motion by the district attorney. The referee found that appellant was a person within Welfare and Institutions Code section 602. Later in the hearing, the referee advised appellant that there was a possibility that any existing probation orders might be revoked at the dispositional hearing.
At the dispositional hearing the juvenile court judge stated at the outset that he had reviewed the probation report but had decided to commit appellant to the Youth Authority rather than Camp Erwin Owen, as recommended in the report. When the judge stated that the commitment would be based upon appellant's "entire record" and would exceed six months, appellant's counsel moved to withdraw the admission of the *41 petty theft charge on the ground that appellant had been told that his commitment would not exceed six months for the offense. The judge denied the motion.
The judge thereupon ordered that appellant be committed to the custody of the Youth Authority for six months for the petty theft violation; he also revoked probation in the previous proceeding which involved six batteries and ordered appellant's custody at the Youth Authority to be continued for an additional six months for each of the six batteries. The judge also revoked probation on an attempted petty theft violation committed in 1975, ordering that appellant's custody be extended an additional period of three months. The period of confinement, less 21 days of credit, totaled 44 months and 9 days. The court ordered that appellant not be held by CYA beyond his 21st birthday.

DISCUSSION
(1) The juvenile court abused its discretion in denying appellant's motion to withdraw his admission of the petty theft charge on the ground that he did not fully understand the consequences of his plea. (In re Tahl (1969) 1 Cal.3d 122 [81 Cal. Rptr. 577, 460 P.2d 449]; In re Ronald E. (1977) 19 Cal.3d 315, 321 [137 Cal. Rptr. 781, 562 P.2d 684].) It was not until after the referee had accepted appellant's plea to the petty theft at the jurisdictional hearing that appellant was advised of the possibility that his probation might be revoked on the earlier charges. Moreover, notice that probation might be revoked on the earlier charges does not necessarily mean that appellant would be subjected to more than six months total confinement. Since appellant sought to withdraw his plea before he was sentenced, not afterward for the first time on appeal, any doubts about granting the motion should have been resolved in his favor. (See, by analogy, Fain v. Superior Court (1970) 2 Cal.3d 46, 54 [84 Cal. Rptr. 135, 465 P.2d 23].) The People would not have been prejudiced if appellant had been allowed to withdraw his admission at this stage of the proceedings.
The Attorney General's reliance on People v. Searcie (1974) 37 Cal. App.3d 204, 211 [112 Cal. Rptr. 267] and People v. Martinez (1975) 46 Cal. App.3d 736, 745 [120 Cal. Rptr. 362, 121 P.2d 443] for the proposition that the revocation of probation on the earlier charges was merely a collateral consequence of appellant's plea to the petty theft charge is misplaced. Searcie and Martinez are both factually and legally distinguishable from the present case. In those cases the probation revocations *42 were collateral consequences involving separate sentencing proceedings from the charges which were admitted. Additionally, the defendants were well aware before they entered their guilty pleas of the probability that their pleas would result in probation revocations leading to state prison sentences.
In the present case appellant had been committed to Kern Youth Facility for the six batteries. After being discharged from the facility he was placed on probation. When appellant was sentenced on the petty theft violation, the juvenile judge revived these battery violations and used them to extend the commitment to CYA. This augmented commitment cannot be characterized as "collateral" in the same sense as in Searcie and Martinez: it was directly imposed by the same judge at the same proceeding as the underlying charge. It was an integral part of the petty theft commitment. We hold, therefore, that the revocation of probation at a dispositional hearing is a direct consequence of an admission, and a juvenile must be apprised of the possibility of such revocation before entering his admission.
Appellant also argues that the court abused its discretion in committing him for 36 months for the 6 prior batteries. The batteries involved lewd but nonviolent touchings of six students at his high school during one morning. While we would agree with appellant that the imposition of six consecutive periods of confinement for these incidents was excessive, we need not reach this issue since we are reversing the underlying commitment. By the same token we need not reach appellant's argument that the commitment constituted cruel and unusual punishment.
The judgment is reversed. The matter is remanded with directions to permit appellant to withdraw his admission of the petty theft charge.
Brown (G.A.), P.J., and Ginsburg, J.,[*] concurred.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
