PHOENIX (AP) -- Buster Posey is hitting nearly everything thrown to him, and he's so good at going the other way he almost appears to be taking the ball out of the catcher's glove.
"Buster is pretty ... talented," Lincecum said. "I don't know any other way to say it."
Posey had four hits to extend his hitting streak to 18 games and set up Travis Ishikawa's run-scoring single in the 10th inning, helping the San Francisco Giants beat the Diamondbacks 3-2 on Sunday to complete their first four-game sweep in Arizona in nine years.
Posey matched his career high in hits and drove in two runs against the Diamondbacks to pass Orlando Cepeda for the second-longest hitting streak by a Giants rookie, just four behind Willie McCovey's 1959 record. He's hit .479 in July to raise his season average to .371 and has 24 RBIs to tie Jim Ray Hart's team rookie record for a month, set in 1964.
Posey started the winning rally against the Diamondbacks with his second double before being replaced by pinch-runner Eli Whiteside. Whiteside then scored easily on Ishikawa's single off Esmerling Vasquez (1-3) that gave the Giants their first four-game sweep in Arizona since July 26-29, 2001.
Brian Wilson pitched a perfect 10th for his 29th save in 31 chances, helping the Giants stay within three games of San Diego in the NL West after their 16th win in 20 games.
"It's always fun when you're winning," Posey said.
Arizona made a big trade during the game, trading All-Star right-hander Dan Haren to the Los Angeles Angels.
The last-place Diamondbacks were looking to move Haren's big contract ahead of the July 31 non-waiver trading deadline and picked up a starter, two prospects and a player to be named later.
In return for the three-time All-Star, Arizona acquired left-hander Joe Saunders and right-hander Rafael Rodriguez, along with minor leaguer Patrick Corbin, from the Angels. Haren has averaged 15 wins over the past five seasons and is 7-8 with a 4.60 ERA in 21 starts this year. He was tied for the NL lead with 141 strikeouts through Saturday's games.
"It is a chance for us to restructure our roster and give it a different look," interim GM Jerry Dipoto said. "One of the things we talked about three weeks ago was taking our current major league club and reconnecting it to our greatest depth, which is at the A-levels of the minor leagues. This deal did both of those."
On the field, Justin Upton had three hits to extend his hitting streak to 12 games, but the Diamondbacks couldn't capitalize on good scoring chances in the final to two innings.
In the ninth inning, Arizona had runners on the corners with one out, only to spoil with strikeouts by Cole Gillespie and Chris Young off Sergio Romo (3-3).
Lincecum made a similar escape in the eighth, getting Adam LaRoche to hit a too-shallow fly to left and a double play when third baseman Juan Uribe snared Miguel Montero's liner and doubled off Upton at first.
Arizona stranded eight runners and was 5 for 35 with runners in scoring position during the series.
"We missed our opportunities," Arizona manager Kirk Gibson said. "You don't know how frustrating that is. You can't imagine."
The Giants were playing thin with outfielder Eugenio Velez on the mend and third baseman Pablo Sandoval headed to Venezuela for a couple of days.
Velez was struck on the head by a foul ball in the dugout against the Diamondbacks Saturday and spent the night in the hospital. He has a concussion, but was expected to travel home with the team. Sandoval went home to attend to a personal matter and was expected to return by Tuesday, at the latest.
Lincecum did his best to keep the Giants from needing them in the lineup, regaining his command after a shaky outing against the Dodgers on Tuesday.
The player the two-time NL Cy Young winner had the most trouble with was Diamondbacks pitcher Barry Enright, who had one career hit before Sunday. The rookie knocked San Francisco's ace for a two-run double for his first extra-base hit and added a single in the fifth.
Lincecum was good against everyone else, wriggling out of the jam in the eighth before being replaced by Romo in the ninth after allowing two runs on nine hits.
"Not to take anything away from him, but those are situations where you don't want to give up runs to a pitcher," Lincecum said. "That was the only frustrating part."
Enright did his part, limiting the damage of eight hits and three walks over six innings. Posey was the only one to hurt the right-hander, hitting a run-scoring double in the first inning and an RBI single in the fifth that tied the game at 2.
Enright allowed two runs, the fifth straight start he's given up three or less.
"It was one of those games that you kind of really have nothing but you kind of get through," Enright said. "I was lucky that I gave up just two runs."
It just wasn't enough.
NOTES: Giants 2B Freddy Sanchez made a sliding stop and threw out Montero from his backside in the second inning. ... Upton is 20 for 47 with nine doubles during a 12-game hitting streak. ... The Giants hadn't swept the Diamondbacks anywhere since July 21-24, 2003.