mercurial/bundle2.py
changeset 21060 0bea9db7543b
parent 21024 7731a2281cf0
child 21062 e7c0a65a5c9c
equal deleted inserted replaced
21059:d7e233df48e6 21060:0bea9db7543b
   655 def handlechangegroup(op, inpart):
   655 def handlechangegroup(op, inpart):
   656     p = dict(inpart.advisoryparams)
   656     p = dict(inpart.advisoryparams)
   657     ret = int(p['return'])
   657     ret = int(p['return'])
   658     op.records.add('changegroup', {'return': ret}, int(p['in-reply-to']))
   658     op.records.add('changegroup', {'return': ret}, int(p['in-reply-to']))
   659 
   659 
       
   660 @parthandler('check:heads')
       
   661 def handlechangegroup(op, inpart):
       
   662     """check that head of the repo did not change
       
   663 
       
   664     This is used to detect a push race when using unbundle.
       
   665     This replaces the "heads" argument of unbundle."""
       
   666     h = inpart.read(20)
       
   667     heads = []
       
   668     while len(h) == 20:
       
   669         heads.append(h)
       
   670         h = inpart.read(20)
       
   671     assert not h
       
   672     if heads != op.repo.heads():
       
   673         raise exchange.PushRaced()