diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2804,7 +2804,7 @@ class generatorset(abstractsmartset): pass return self.first() if self: - return it.next() + return it().next() return None def last(self): @@ -2818,7 +2818,7 @@ class generatorset(abstractsmartset): pass return self.first() if self: - return it.next() + return it().next() return None def spanset(repo, start=None, end=None): diff --git a/tests/test-issue619.t b/tests/test-issue619.t --- a/tests/test-issue619.t +++ b/tests/test-issue619.t @@ -28,3 +28,9 @@ Bogus fast-forward should fail: abort: merging with a working directory ancestor has no effect [255] +Even with strange revset (issue4465) + + $ hg merge ::. + abort: merging with a working directory ancestor has no effect + [255] +