Sukkah, Chapter 3, Mishnah 13. This mishnah deals with the halachah and the practical order of conduct when the first day of Sukkos falls on Shabbos.
Ordinarily we do not take the lulav and esrog on Shabbos, out of concern that a person may come to carry them. However, on the first day of Sukkos that falls on Shabbos, in the time when the Beis HaMikdash stood, they did take the lulav and esrog - both in the Mikdash and outside of it. That was the only day on which the lulav and esrog were taken on Shabbos.
The mishnah describes the procedure for taking the lulav on Shabbos outside the Beis HaMikdash:
"Yom Tov harishon shel hechag shechal lihyos b'Shabbos" - on the first day of Sukkos that falls on Shabbos, there is no way to carry the lulav and esrog.
"Kol ha'umah holchin es lulaveihen l'vatei knesios" - every member of the community would bring his lulav to the shul before Shabbos began.
"L'macharas mashkimin u'va'in" - on Shabbos day they would rise early and come to the shul.
"Kol echad v'echad makir es shelo v'notlo" - each person would identify his own lulav and esrog and take it.
The reason for this:
"Mipnei she'amru chachamim: ein adam yotzei yedei chovaso b'Yom Tov harishon shel hechag b'lulavo shel chaveiro" - the need for precise identification stems from the fact that on the first day of Yom Tov a person does not fulfill his obligation of taking the lulav and esrog with his friend's lulav; the lulav must belong to him.
"Ulam she'ar yemos hechag adam yotzei yedei chovaso b'lulavo shel chaveiro" - on the remaining days of the festival a person may fulfill the mitzvah with his friend's lulav.
In practice, since we keep the second day as Yom Tov as well, we are careful that the lulav belong to us on the second day too, because of the doubt as to whether it is in fact the first day; therefore we apply this halachah on both days. On all the remaining days of Sukkos, however, a person may borrow his friend's lulav and fulfill the mitzvah with it.
In summary: on the first day of Sukkos that falls on Shabbos they did take the lulav and esrog, even though on an ordinary Shabbos they are not taken. And since a person does not fulfill his obligation on the first day with his friend's lulav, they would bring the lulavim to the shul before Shabbos, and the next morning each person would identify his own and take it.