[PATCH 14 of 27 clfilter V2] clfilter: use unfiltered repo for push bookmarks logic

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Oct 8 16:38:05 CDT 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1349711402 -7200
# Node ID ccc8fa90468e58b6ca993a2608a6be7f35ac15ed
# Parent  3a48d439e796a94bafc197dbb819d1e11df40167
clfilter: use unfiltered repo for push bookmarks logic

Remote location of the bookmark may be filtered locally. This changeset ensures
that bookmarks movement logic have access to all the repo content.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1871,6 +1871,7 @@
         if not remote.canpush():
             raise util.Abort(_("destination does not support push"))
         # get local lock as we might write phase data
+        unfi = self.unfiltered()
         locallock = self.lock()
         try:
             self.checkpush(force, revs)
@@ -1879,7 +1880,6 @@
             if not unbundle:
                 lock = remote.lock()
             try:
-                unfi = self.unfiltered()
                 # discovery
                 fci = discovery.findcommonincoming
                 commoninc = fci(unfi, remote, force=force)
@@ -2019,12 +2019,12 @@
         self.ui.debug("checking for updated bookmarks\n")
         rb = remote.listkeys('bookmarks')
         for k in rb.keys():
-            if k in self._bookmarks:
+            if k in unfi._bookmarks:
                 nr, nl = rb[k], hex(self._bookmarks[k])
-                if nr in self:
-                    cr = self[nr]
-                    cl = self[nl]
-                    if bookmarks.validdest(self, cr, cl):
+                if nr in unfi:
+                    cr = unfi[nr]
+                    cl = unfi[nl]
+                    if bookmarks.validdest(unfi, cr, cl):
                         r = remote.pushkey('bookmarks', k, nr, nl)
                         if r:
                             self.ui.status(_("updating bookmark %s\n") % k)


More information about the Mercurial-devel mailing list