A whole lot is going to depend upon the design, as well as the cartridge itself.
For example, the old Colt double action revolvers would go out of time before the S&W revolvers would. For longevity, I would choose S&W over Colt. I would prefer Ruger over either, however. The Security-Six I bought 35 years ago is still going strong, for example.
If longevity is the goal, I would rather have a semi-automatic, though. Especially if I can keep just a few parts.
The auto is easier to work on, though the recoil spring does need changing occasionallly, and magazines don't last forever.
I would say that the general answer has already been discovered by most military and law enforcement. The semi-automatic pistol is much easier to keep in service long term.
Revolvers can still outlast a lot of the people that shoot them, however.