Patchwork [2,of,3,STABLE] bundlerepo: ignore secret revisions at "known()" according to filtered or not

login
register
mail settings
Submitter Katsunori FUJIWARA
Date May 28, 2013, 3:02 p.m.
Message ID <b36954ea6f53c20a428d.1369753373@feefifofum>
Download mbox | patch
Permalink /patch/1666/
State Changes Requested, archived
Delegated to: Pierre-Yves David
Headers show

Comments

Katsunori FUJIWARA - May 28, 2013, 3:02 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1369751670 -32400
#      Tue May 28 23:34:30 2013 +0900
# Branch stable
# Node ID b36954ea6f53c20a428d3503ee2964457bea21a2
# Parent  32537a1588d2b80e9d40d8c61327391162f2b929
bundlerepo: ignore secret revisions at "known()" according to filtered or not

This is required to fix "hg incoming" problem in succeeding patch.

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -166,6 +166,9 @@ 
     def canpush(self):
         return False
 
+    def known(self, nodes):
+        return self._repo.known(nodes, ignoresecert=self._filtered)
+
     def unfiltered(self):
         if not self._filtered:
             return self
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -675,13 +675,14 @@ 
         repo = (remote and remote.local()) and remote or self
         return repo[key].branch()
 
-    def known(self, nodes):
+    def known(self, nodes, ignoresecert=True):
         nm = self.changelog.nodemap
         pc = self._phasecache
         result = []
         for n in nodes:
             r = nm.get(n)
-            resp = not (r is None or pc.phase(self, r) >= phases.secret)
+            resp = not (r is None or
+                        (ignoresecert and pc.phase(self, r) >= phases.secret))
             result.append(resp)
         return result