states.py
changeset 7 cc592295900f
parent 5 9445ce78a935
child 9 1f84a74df837
equal deleted inserted replaced
6:2ec66dbe2ebe 7:cc592295900f
    27 from mercurial import util
    27 from mercurial import util
    28 from mercurial import node
    28 from mercurial import node
    29 from mercurial.node import nullid
    29 from mercurial.node import nullid
    30 from mercurial import discovery
    30 from mercurial import discovery
    31 from mercurial import extensions
    31 from mercurial import extensions
       
    32 from mercurial import wireproto
    32 
    33 
    33 
    34 
    34 _NOPULLPUSH=2
    35 _NOPULLPUSH=2
    35 
    36 
    36 STATES = (0, _NOPULLPUSH)
    37 STATES = (0, _NOPULLPUSH)
   103         heads = remote._reducehead(heads)
   104         heads = remote._reducehead(heads)
   104         return common, anyinc, heads
   105         return common, anyinc, heads
   105 
   106 
   106     extensions.wrapfunction(discovery, 'findcommonoutgoing', filterprivateout)
   107     extensions.wrapfunction(discovery, 'findcommonoutgoing', filterprivateout)
   107     extensions.wrapfunction(discovery, 'findcommonincoming', filterprivatein)
   108     extensions.wrapfunction(discovery, 'findcommonincoming', filterprivatein)
       
   109 
       
   110     # Write protocols
       
   111     ####################
       
   112     def heads(repo, proto):
       
   113         h = repo._publicheads
       
   114         return wireproto.encodelist(h) + "\n"
       
   115 
       
   116     def _reducehead(wirerepo, heads):
       
   117         """heads filtering is done repo side"""
       
   118         return heads
       
   119 
       
   120     wireproto.wirerepository._reducehead = _reducehead
       
   121     wireproto.commands['heads'] = (heads, '')
   108 
   122 
   109 def reposetup(ui, repo):
   123 def reposetup(ui, repo):
   110 
   124 
   111     if not repo.local():
   125     if not repo.local():
   112         return
   126         return