Patchwork [11,of,16] clfilter: use empty frozenset intead of empty tuple

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 2, 2013, 1:09 a.m.
Message ID <bb98e3c68f91154193fe.1357088973@yamac.lan>
Download mbox | patch
Permalink /patch/357/
State Superseded, archived
Commit c0c943ef4e5530c73c9c2302b552e4ce3cb4cd93
Headers show

Comments

Pierre-Yves David - Jan. 2, 2013, 1:09 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1357087206 -3600
# Node ID bb98e3c68f91154193fed5fcb54e4c1960714f12
# Parent  d149d6401ce3da07faa2c62dd21ae7a0a0d375a5
clfilter: use empty frozenset intead of empty tuple

This will allows set operation needed for cache collaboration.

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -122,11 +122,11 @@  class changelog(revlog.revlog):
             self.version &= ~revlog.REVLOGGENERALDELTA
             self._generaldelta = False
         self._realopener = opener
         self._delayed = False
         self._divert = False
-        self.filteredrevs = ()
+        self.filteredrevs = frozenset()
 
     def tip(self):
         """filtered version of revlog.tip"""
         for i in xrange(len(self) -1, -2, -1):
             if i not in self.filteredrevs:
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -15,11 +15,11 @@  def computeunserved(repo):
     Secret and hidden changeset should not pretend to be here."""
     assert not repo.changelog.filteredrevs
     # fast path in simple case to avoid impact of non optimised code
     if phases.hassecret(repo) or repo.obsstore:
         return frozenset(repo.revs('hidden() + secret()'))
-    return ()
+    return frozenset()
 
 # function to compute filtered set
 filtertable = {'unserved': computeunserved}
 
 def filteredrevs(repo, filtername):