# HG changeset patch # User Pierre-Yves David # Date 2014-12-01 13:18:12 # Node ID 0c432696dae340162bc7818fddf743774c83ee46 # Parent 94092019e8395f4ee9570a5712981a13545aaf51 revset: fix first and last for generatorset (issue4465) The code was just plain wrong. 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] +