When the petition is presented the court shall fix a day for hearing it and direct that notice of the presentation of the petition and of the day of hearing shall be given to the commissioners of the counties affected by the proposed change of boundaries. If one of the counties affected is coterminous with a city the notice shall also be given to the council of the city. The county or city or both may file answers to said petition and if any city to which said part of a county or a borough would be attached for municipal and school purposes answers that by ordinance it has taken action against the change of said boundary the proceedings shall be dismissed by the court. On the day fixed for hearing, or as soon thereafter as the business of the court will permit, the court shall hear all parties in interest and shall make such decree as to the court shall seem right and proper.
16 P.S. § 7173