  Massive stars likely form by accretion and the evolutionary track of an
accreting forming star corresponds to what is called the birthline in the HR
diagram. The shape of this birthline is quite sensitive to the evolution of the
entropy in the accreting star. We first study the reasons why some birthlines
published in past years present different behaviours for a given accretion
rate. We then revisit the question of the accretion rate, which allows us to
understand the distribution of the observed pre-main-sequence (pre-MS) stars in
the Hertzsprung-Russell (HR) diagram. Finally, we identify the conditions
needed to obtain a large inflation of the star along its pre-MS evolution that
may push the birthline towards the Hayashi line in the upper part of the HR
diagram. We present new pre-MS models including accretion at various rates and
for different initial structures of the accreting core. From the observed upper
envelope of pre-MS stars in the HR diagram, we deduce the accretion law that
best matches the accretion history of most of the intermediate-mass stars. In
the case of cold disc accretion, the existence of a significant swelling during
the accretion phase, which leads to radii $\gtrsim100\,R_\odot$ and brings the
star back to the red part of the HR diagram, depends sensitively on the initial
conditions. For an accretion rate of $10^{-3}\,M_\odot\rm\,yr^{-1}$, only
models starting from a core with a significant radiative region evolve back to
the red part of the HR diagram. We also obtain that, in order to reproduce the
observed upper envelope of pre-MS stars in the HR diagram with an accretion law
deduced from the observed mass outflows in ultra-compact HII regions, the mass
effectively accreted onto the star with respect to the total in falling matter
decreases when the mass of the star increases.
