diff -r 822e75386c16 -r fcb97d9a26cd mercurial/patch.py --- a/mercurial/patch.py Fri May 11 22:48:19 2012 -0700 +++ b/mercurial/patch.py Sat May 12 16:10:01 2012 +0900 @@ -1014,9 +1014,9 @@ oldstart = self.starta + top newstart = self.startb + top # zero length hunk ranges already have their start decremented - if self.lena: + if self.lena and oldstart > 0: oldstart -= 1 - if self.lenb: + if self.lenb and newstart > 0: newstart -= 1 return old, oldstart, new, newstart