# HG changeset patch # User Matt Mackall # Date 1321824595 21600 # Node ID 5edaf47cd462991d074b6624f813575fd0cd2466 # Parent 0810ccc51f0adfc1805fa3ce8113be6f4d7aeed3 revset: follow(nosuchfile) should give an empty set (issue3114) diff -r 0810ccc51f0a -r 5edaf47cd462 mercurial/revset.py --- a/mercurial/revset.py Fri Nov 11 11:11:11 2011 +1111 +++ b/mercurial/revset.py Sun Nov 20 15:29:55 2011 -0600 @@ -434,7 +434,10 @@ p = repo['.'].rev() if l: x = getstring(l[0], _("follow expected a filename")) - s = set(ctx.rev() for ctx in repo['.'][x].ancestors()) + if x in repo['.']: + s = set(ctx.rev() for ctx in repo['.'][x].ancestors()) + else: + return [] else: s = set(repo.changelog.ancestors(p))