Mercurial > public > mercurial-scm > hg
comparison mercurial/mdiff.py @ 15471:f520c9616db5
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 10 Nov 2011 11:00:27 -0600 |
parents | 8f08b635cdce 2b1ec74c961f |
children | 646759147717 |
comparison
equal
deleted
inserted
replaced
15468:99824055d323 | 15471:f520c9616db5 |
---|---|
181 # by recording this hunk's starting point as the next place to | 181 # by recording this hunk's starting point as the next place to |
182 # start looking for function lines, we avoid reading any line in | 182 # start looking for function lines, we avoid reading any line in |
183 # the file more than once. | 183 # the file more than once. |
184 lastfunc[0] = astart | 184 lastfunc[0] = astart |
185 | 185 |
186 yield "@@ -%d,%d +%d,%d @@%s\n" % (astart + 1, alen, | 186 # zero-length hunk ranges report their start line as one less |
187 bstart + 1, blen, func) | 187 if alen: |
188 astart += 1 | |
189 if blen: | |
190 bstart += 1 | |
191 | |
192 yield "@@ -%d,%d +%d,%d @@%s\n" % (astart, alen, | |
193 bstart, blen, func) | |
188 for x in delta: | 194 for x in delta: |
189 yield x | 195 yield x |
190 for x in xrange(a2, aend): | 196 for x in xrange(a2, aend): |
191 yield ' ' + l1[x] | 197 yield ' ' + l1[x] |
192 | 198 |