(Prompted by this baseball-reference blog post. Must have hit at least 1 home run in each season.)
Record for 7 years in a row: 1, Al Orth, 1895-1901.
Record for 6 years in a row: 2, Al Evans, 1945-1950.
Record for 5 years in a row: 4, Sam Wise, 1882-1886.
Record for 4 years in a row: 40, Adam Dunn, 2005-2008.
Others:
24, Ken Boyer, 1961-1964;
23, Fred Lynn, 1984-1987.
Record for 3 years in a row: 40, Dunn, 2005-2007, 2006-2008.
Others:
38, Mike Schmidt, 1975-1977;
36, Dale Murphy, 1982-1984.
Record for 2 years in a row: 56, Ken Griffey Jr., 1997-1998.
Others:
45, Barry Bonds, 2003-2004;
42, Alex Rodriguez, 1998-1999;
41, Jason Giambi, 2002-2003.
Great stuff here, but you need to add some names to those with the same # of home runs in three consecutive seasons. Both Adam Laroche and Hunter Pence joined the club in 2010.
Adam Laroche hit 25 from 2008-2010. In 2009, he hit 12 with the Pirates, 1 with the Red Sox, and 12 with the Braves.
Pence also hit 25 from 2008-2010 with the Astros.