# HG changeset patch # User Pierre-Yves David # Date 1417439892 28800 # Node ID 0c432696dae340162bc7818fddf743774c83ee46 # Parent 94092019e8395f4ee9570a5712981a13545aaf51 revset: fix first and last for generatorset (issue4465) The code was just plain wrong. diff -r 94092019e839 -r 0c432696dae3 mercurial/revset.py --- a/mercurial/revset.py Fri Nov 28 02:57:33 2014 +0100 +++ b/mercurial/revset.py Mon Dec 01 05:18:12 2014 -0800 @@ -2804,7 +2804,7 @@ pass return self.first() if self: - return it.next() + return it().next() return None def last(self): @@ -2818,7 +2818,7 @@ pass return self.first() if self: - return it.next() + return it().next() return None def spanset(repo, start=None, end=None): diff -r 94092019e839 -r 0c432696dae3 tests/test-issue619.t --- a/tests/test-issue619.t Fri Nov 28 02:57:33 2014 +0100 +++ b/tests/test-issue619.t Mon Dec 01 05:18:12 2014 -0800 @@ -28,3 +28,9 @@ 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] +