revset: fix first and last for generatorset (
issue4465)
The code was just plain wrong.
--- 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):
--- 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]
+