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

login
register
mail settings
Submitter Katsunori FUJIWARA
Date May 28, 2013, 3:02 p.m.
Message ID <32537a1588d2b80e9d40.1369753372@feefifofum>
Download mbox | patch
Permalink /patch/1667/
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 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.

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