##// END OF EJS Templates
obsolete: fix n^2 marker computation behavior...
Durham Goode -
r27984:e60e13a8 default
parent child Browse files
Show More
@@ -1225,6 +1225,7 b' def createmarkers(repo, relations, flag='
1225 metadata['user'] = repo.ui.username()
1225 metadata['user'] = repo.ui.username()
1226 tr = repo.transaction('add-obsolescence-marker')
1226 tr = repo.transaction('add-obsolescence-marker')
1227 try:
1227 try:
1228 markerargs = []
1228 for rel in relations:
1229 for rel in relations:
1229 prec = rel[0]
1230 prec = rel[0]
1230 sucs = rel[1]
1231 sucs = rel[1]
@@ -1243,6 +1244,15 b' def createmarkers(repo, relations, flag='
1243 npare = tuple(p.node() for p in prec.parents())
1244 npare = tuple(p.node() for p in prec.parents())
1244 if nprec in nsucs:
1245 if nprec in nsucs:
1245 raise error.Abort("changeset %s cannot obsolete itself" % prec)
1246 raise error.Abort("changeset %s cannot obsolete itself" % prec)
1247
1248 # Creating the marker causes the hidden cache to become invalid,
1249 # which causes recomputation when we ask for prec.parents() above.
1250 # Resulting in n^2 behavior. So let's prepare all of the args
1251 # first, then create the markers.
1252 markerargs.append((nprec, nsucs, npare, localmetadata))
1253
1254 for args in markerargs:
1255 nprec, nsucs, npare, localmetadata = args
1246 repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare,
1256 repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare,
1247 date=date, metadata=localmetadata)
1257 date=date, metadata=localmetadata)
1248 repo.filteredrevcache.clear()
1258 repo.filteredrevcache.clear()
General Comments 0
You need to be logged in to leave comments. Login now