Patchwork [13,of,18,V2] clfilter: use empty frozenset intead of empty tuple

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 4, 2013, 1:04 a.m.
Message ID <3a28bc72c1e1341fbf80.1357261456@yamac.lan>
Download mbox | patch
Permalink /patch/382/
State Accepted
Commit c0c943ef4e5530c73c9c2302b552e4ce3cb4cd93
Headers show

Comments

Pierre-Yves David - Jan. 4, 2013, 1:04 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1357087206 -3600
# Node ID 3a28bc72c1e1341fbf805fa72f2442f53eb75387
# Parent  cbf55b9764e718ea3165cdd480facff39ef737d1
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):