revset: fix first and last for generatorset (issue4465) stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 01 Dec 2014 05:18:12 -0800
branchstable
changeset 23413 0c432696dae3
parent 23412 94092019e839
child 23414 759202b64f49
revset: fix first and last for generatorset (issue4465) The code was just plain wrong.
mercurial/revset.py
tests/test-issue619.t
--- 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]
+