equal
deleted
inserted
replaced
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() |