mercurial/localrepo.py
changeset 11368 b9eb005c54ad
parent 11303 a1aad8333864
child 11442 ee1ed6afac21
equal deleted inserted replaced
11367:ca4fc993087c 11368:b9eb005c54ad
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from node import bin, hex, nullid, nullrev, short
     8 from node import bin, hex, nullid, nullrev, short
     9 from i18n import _
     9 from i18n import _
    10 import repo, changegroup, subrepo, discovery
    10 import repo, changegroup, subrepo, discovery, pushkey
    11 import changelog, dirstate, filelog, manifest, context
    11 import changelog, dirstate, filelog, manifest, context
    12 import lock, transaction, store, encoding
    12 import lock, transaction, store, encoding
    13 import util, extensions, hook, error
    13 import util, extensions, hook, error
    14 import match as matchmod
    14 import match as matchmod
    15 import merge as mergemod
    15 import merge as mergemod
    18 from lock import release
    18 from lock import release
    19 import weakref, errno, os, time, inspect
    19 import weakref, errno, os, time, inspect
    20 propertycache = util.propertycache
    20 propertycache = util.propertycache
    21 
    21 
    22 class localrepository(repo.repository):
    22 class localrepository(repo.repository):
    23     capabilities = set(('lookup', 'changegroupsubset', 'branchmap'))
    23     capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey'))
    24     supported = set('revlogv1 store fncache shared'.split())
    24     supported = set('revlogv1 store fncache shared'.split())
    25 
    25 
    26     def __init__(self, baseui, path=None, create=0):
    26     def __init__(self, baseui, path=None, create=0):
    27         repo.repository.__init__(self)
    27         repo.repository.__init__(self)
    28         self.root = os.path.realpath(util.expandpath(path))
    28         self.root = os.path.realpath(util.expandpath(path))
  1844 
  1844 
  1845         if stream and not heads and remote.capable('stream'):
  1845         if stream and not heads and remote.capable('stream'):
  1846             return self.stream_in(remote)
  1846             return self.stream_in(remote)
  1847         return self.pull(remote, heads)
  1847         return self.pull(remote, heads)
  1848 
  1848 
       
  1849     def pushkey(self, namespace, key, old, new):
       
  1850         return pushkey.push(self, namespace, key, old, new)
       
  1851 
       
  1852     def listkeys(self, namespace):
       
  1853         return pushkey.list(self, namespace)
       
  1854 
  1849 # used to avoid circular references so destructors work
  1855 # used to avoid circular references so destructors work
  1850 def aftertrans(files):
  1856 def aftertrans(files):
  1851     renamefiles = [tuple(t) for t in files]
  1857     renamefiles = [tuple(t) for t in files]
  1852     def a():
  1858     def a():
  1853         for src, dest in renamefiles:
  1859         for src, dest in renamefiles: