Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 3404:1a437b0f4902
Fix annotate where linkrev != rev without exporting linkrev
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Sun, 15 Oct 2006 18:43:46 -0700 |
parents | 372999405787 |
children | 357b5589dc62 |
comparison
equal
deleted
inserted
replaced
3403:372999405787 | 3404:1a437b0f4902 |
---|---|
252 if r: | 252 if r: |
253 pl[0] = (r[0], getlog(r[0]).rev(r[1])) | 253 pl[0] = (r[0], getlog(r[0]).rev(r[1])) |
254 | 254 |
255 return [ getctx(p, n) for p, n in pl if n != -1 ] | 255 return [ getctx(p, n) for p, n in pl if n != -1 ] |
256 | 256 |
257 # use linkrev to find the first changeset where self appeared | |
258 if self.rev() != self._filelog.linkrev(self._filenode): | |
259 base = self.filectx(self.filerev()) | |
260 else: | |
261 base = self | |
262 | |
257 # find all ancestors | 263 # find all ancestors |
258 needed = {self: 1} | 264 needed = {base: 1} |
259 visit = [self] | 265 visit = [base] |
260 files = [self._path] | 266 files = [base._path] |
261 while visit: | 267 while visit: |
262 f = visit.pop(0) | 268 f = visit.pop(0) |
263 for p in parents(f): | 269 for p in parents(f): |
264 if p not in needed: | 270 if p not in needed: |
265 needed[p] = 1 | 271 needed[p] = 1 |