comparison mercurial/localrepo.py @ 18009:67c874d14c2c

clfilter: use unfiltered repo for bookmark push logic The remote location of the bookmark may be filtered locally. This changeset ensures that bookmark movement logic has access to all the repo's content.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 08 Oct 2012 17:50:02 +0200
parents 2e30972d859d
children 98c867ac1330
comparison
equal deleted inserted replaced
18008:cf91b36f368c 18009:67c874d14c2c
1859 # servers, http servers). 1859 # servers, http servers).
1860 1860
1861 if not remote.canpush(): 1861 if not remote.canpush():
1862 raise util.Abort(_("destination does not support push")) 1862 raise util.Abort(_("destination does not support push"))
1863 # get local lock as we might write phase data 1863 # get local lock as we might write phase data
1864 unfi = self.unfiltered()
1864 locallock = self.lock() 1865 locallock = self.lock()
1865 try: 1866 try:
1866 self.checkpush(force, revs) 1867 self.checkpush(force, revs)
1867 lock = None 1868 lock = None
1868 unbundle = remote.capable('unbundle') 1869 unbundle = remote.capable('unbundle')
1869 if not unbundle: 1870 if not unbundle:
1870 lock = remote.lock() 1871 lock = remote.lock()
1871 try: 1872 try:
1872 unfi = self.unfiltered()
1873 # discovery 1873 # discovery
1874 fci = discovery.findcommonincoming 1874 fci = discovery.findcommonincoming
1875 commoninc = fci(unfi, remote, force=force) 1875 commoninc = fci(unfi, remote, force=force)
1876 common, inc, remoteheads = commoninc 1876 common, inc, remoteheads = commoninc
1877 fco = discovery.findcommonoutgoing 1877 fco = discovery.findcommonoutgoing
2010 locallock.release() 2010 locallock.release()
2011 2011
2012 self.ui.debug("checking for updated bookmarks\n") 2012 self.ui.debug("checking for updated bookmarks\n")
2013 rb = remote.listkeys('bookmarks') 2013 rb = remote.listkeys('bookmarks')
2014 for k in rb.keys(): 2014 for k in rb.keys():
2015 if k in self._bookmarks: 2015 if k in unfi._bookmarks:
2016 nr, nl = rb[k], hex(self._bookmarks[k]) 2016 nr, nl = rb[k], hex(self._bookmarks[k])
2017 if nr in self: 2017 if nr in unfi:
2018 cr = self[nr] 2018 cr = unfi[nr]
2019 cl = self[nl] 2019 cl = unfi[nl]
2020 if bookmarks.validdest(self, cr, cl): 2020 if bookmarks.validdest(unfi, cr, cl):
2021 r = remote.pushkey('bookmarks', k, nr, nl) 2021 r = remote.pushkey('bookmarks', k, nr, nl)
2022 if r: 2022 if r:
2023 self.ui.status(_("updating bookmark %s\n") % k) 2023 self.ui.status(_("updating bookmark %s\n") % k)
2024 else: 2024 else:
2025 self.ui.warn(_('updating bookmark %s' 2025 self.ui.warn(_('updating bookmark %s'