1. mirror
  2. mercurial-crew

Commits

Bryan O'Sullivan  committed 49c8554 Merge

Merge with crew-stable

  • Participants
  • Parent commits a1f94e2, 54cedee
  • Branches default

Comments (0)

Files changed (3)

File mercurial/changelog.py

View file
 
     def __iter__(self):
         """filtered version of revlog.__iter__"""
-        for i in xrange(len(self)):
-            if i not in self.filteredrevs:
-                yield i
+        if len(self.filteredrevs) == 0:
+            return revlog.revlog.__iter__(self)
+
+        def filterediter():
+            for i in xrange(len(self)):
+                if i not in self.filteredrevs:
+                    yield i
+
+        return filterediter()
 
     def revs(self, start=0, stop=None):
         """filtered version of revlog.revs"""

File mercurial/revlog.py

View file
     def __len__(self):
         return len(self.index) - 1
     def __iter__(self):
-        for i in xrange(len(self)):
-            yield i
+        return iter(xrange(len(self)))
     def revs(self, start=0, stop=None):
         """iterate over all rev in this revlog (from start to stop)"""
         if stop is None:

File mercurial/revset.py

View file
     if not args:
         return []
     s = set(_revdescendants(repo, args, followfirst)) | set(args)
+
+    if len(subset) == len(repo):
+        # the passed in revisions may not exist, -1 for example
+        for arg in args:
+            if arg not in subset:
+                s.remove(arg)
+        return list(s)
+
     return [r for r in subset if r in s]
 
 def descendants(repo, subset, x):
     Changesets in set with no parent changeset in set.
     """
     s = set(getset(repo, repo.changelog, x))
-    subset = [r for r in subset if r in s]
+    if len(subset) == len(repo):
+        subset = s
+    else:
+        subset = [r for r in subset if r in s]
     cs = _children(repo, subset, s)
     return [r for r in subset if r not in cs]