##// END OF EJS Templates
bundle2: add a "check:heads" handler...
Pierre-Yves David -
r21060:0bea9db7 default
parent child Browse files
Show More
@@ -657,3 +657,17 b' def handlechangegroup(op, inpart):'
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()
General Comments 0
You need to be logged in to leave comments. Login now