“At that time” – at what time? It was at the time that Joshua was appointed, as it is stated: “I commanded Joshua [at that time]” (Deuteronomy 3:21). Rav Huna said: When the Holy One blessed be He said to Moses: ‘Joshua’s tenure has arrived,’ at that moment Moses began asking for mercy to enter the land. To what is the matter comparable?

To a governor who, during his tenure, would issue decrees and the king would fulfill them. He would redeem whom he wanted and imprison whom he wanted. When he was replaced and another was appointed in his stead, he began asking the gatekeeper to enter, but he would not let him. So, Moses, all the days of his tenure he would imprison whom he wanted, as it is stated: “They, and everything that was theirs, descended alive [into the abyss]” (Numbers 16:33).

He redeemed whom he wanted, as it is stated: “Let Reuben live and not die” (Deuteronomy 33:6). When he was replaced and Joshua was appointed in his stead, as it is stated: “Take to you Joshua son of Nun” (Numbers 27:18), he began pleading to enter the land. The Holy One blessed be He said to him: “It is enough for you” (Deuteronomy 3:26).