Show More
@@ -1225,6 +1225,7 b' def createmarkers(repo, relations, flag=' | |||
|
1225 | 1225 | metadata['user'] = repo.ui.username() |
|
1226 | 1226 | tr = repo.transaction('add-obsolescence-marker') |
|
1227 | 1227 | try: |
|
1228 | markerargs = [] | |
|
1228 | 1229 | for rel in relations: |
|
1229 | 1230 | prec = rel[0] |
|
1230 | 1231 | sucs = rel[1] |
@@ -1243,6 +1244,15 b' def createmarkers(repo, relations, flag=' | |||
|
1243 | 1244 | npare = tuple(p.node() for p in prec.parents()) |
|
1244 | 1245 | if nprec in nsucs: |
|
1245 | 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 | 1256 | repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare, |
|
1247 | 1257 | date=date, metadata=localmetadata) |
|
1248 | 1258 | repo.filteredrevcache.clear() |
General Comments 0
You need to be logged in to leave comments.
Login now