##// END OF EJS Templates
revset: include the correct first ancestor change for follow(file)...
Matt Mackall -
r15966:610c4434 stable
parent child Browse files
Show More
@@ -449,17 +449,20 b' def follow(repo, subset, x):'
449 """
449 """
450 # i18n: "follow" is a keyword
450 # i18n: "follow" is a keyword
451 l = getargs(x, 0, 1, _("follow takes no arguments or a filename"))
451 l = getargs(x, 0, 1, _("follow takes no arguments or a filename"))
452 p = repo['.'].rev()
452 c = repo['.']
453 if l:
453 if l:
454 x = getstring(l[0], _("follow expected a filename"))
454 x = getstring(l[0], _("follow expected a filename"))
455 if x in repo['.']:
455 if x in c:
456 s = set(ctx.rev() for ctx in repo['.'][x].ancestors())
456 cx = c[x]
457 s = set(ctx.rev() for ctx in cx.ancestors())
458 # include the revision responsible for the most recent version
459 s.add(cx.linkrev())
457 else:
460 else:
458 return []
461 return []
459 else:
462 else:
460 s = set(repo.changelog.ancestors(p))
463 s = set(repo.changelog.ancestors(c.rev()))
464 s.add(c.rev())
461
465
462 s |= set([p])
463 return [r for r in subset if r in s]
466 return [r for r in subset if r in s]
464
467
465 def getall(repo, subset, x):
468 def getall(repo, subset, x):
General Comments 0
You need to be logged in to leave comments. Login now