[PATCH 1 of 3 STABLE] bundlerepo: add "unfiltered()" to bundlepeer to get peer using unfiltered repo

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Tue May 28 10:02:52 CDT 2013


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1369751660 -32400
#      Tue May 28 23:34:20 2013 +0900
# Branch stable
# Node ID 32537a1588d2b80e9d40d8c61327391162f2b929
# Parent  39ea540dc1543b5ed31251ef9f394c7902c65f19
bundlerepo: add "unfiltered()" to bundlepeer to get peer using unfiltered repo

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

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -166,6 +166,12 @@
     def canpush(self):
         return False
 
+    def unfiltered(self):
+        if not self._filtered:
+            return self
+        return bundlepeer(self._repo.unfiltered(),
+                          caps=self._caps, filtered=False)
+
 class bundlerepository(localrepo.localrepository):
     def __init__(self, ui, path, bundlename):
         self._tempparent = None
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -64,9 +64,13 @@
 class localpeer(peer.peerrepository):
     '''peer for a local repo; reflects only the most recent API'''
 
-    def __init__(self, repo, caps=MODERNCAPS):
+    def __init__(self, repo, caps=MODERNCAPS, filtered=True):
         peer.peerrepository.__init__(self)
-        self._repo = repo.filtered('served')
+        if filtered:
+            self._repo = repo.filtered('served')
+        else:
+            self._repo = repo
+        self._filtered = filtered
         self.ui = repo.ui
         self._caps = repo._restrictcapabilities(caps)
         self.requirements = repo.requirements


More information about the Mercurial-devel mailing list