Show More
@@ -1043,6 +1043,11 b' def createmarkers(repo, relations, flag=' | |||||
1043 | if useoperation and operation: |
|
1043 | if useoperation and operation: | |
1044 | metadata['operation'] = operation |
|
1044 | metadata['operation'] = operation | |
1045 |
|
1045 | |||
|
1046 | # Effect flag metadata handling | |||
|
1047 | saveeffectflag = repo.ui.configbool('experimental', | |||
|
1048 | 'effect-flags', | |||
|
1049 | False) | |||
|
1050 | ||||
1046 | tr = repo.transaction('add-obsolescence-marker') |
|
1051 | tr = repo.transaction('add-obsolescence-marker') | |
1047 | try: |
|
1052 | try: | |
1048 | markerargs = [] |
|
1053 | markerargs = [] | |
@@ -1066,6 +1071,13 b' def createmarkers(repo, relations, flag=' | |||||
1066 | raise error.Abort(_("changeset %s cannot obsolete itself") |
|
1071 | raise error.Abort(_("changeset %s cannot obsolete itself") | |
1067 | % prec) |
|
1072 | % prec) | |
1068 |
|
1073 | |||
|
1074 | # Effect flag can be different by relation | |||
|
1075 | if saveeffectflag: | |||
|
1076 | # The effect flag is saved in a versioned field name for future | |||
|
1077 | # evolution | |||
|
1078 | effectflag = obsutil.geteffectflag(rel) | |||
|
1079 | localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag | |||
|
1080 | ||||
1069 | # Creating the marker causes the hidden cache to become invalid, |
|
1081 | # Creating the marker causes the hidden cache to become invalid, | |
1070 | # which causes recomputation when we ask for prec.parents() above. |
|
1082 | # which causes recomputation when we ask for prec.parents() above. | |
1071 | # Resulting in n^2 behavior. So let's prepare all of the args |
|
1083 | # Resulting in n^2 behavior. So let's prepare all of the args |
@@ -305,6 +305,19 b' def foreground(repo, nodes):' | |||||
305 | foreground = set(repo.set('%ln::', known)) |
|
305 | foreground = set(repo.set('%ln::', known)) | |
306 | return set(c.node() for c in foreground) |
|
306 | return set(c.node() for c in foreground) | |
307 |
|
307 | |||
|
308 | # logic around storing and using effect flags | |||
|
309 | EFFECTFLAGFIELD = "ef1" | |||
|
310 | ||||
|
311 | def geteffectflag(relation): | |||
|
312 | """ From an obs-marker relation, compute what changed between the | |||
|
313 | predecessor and the successor. | |||
|
314 | """ | |||
|
315 | effects = 0 | |||
|
316 | ||||
|
317 | source = relation[0] | |||
|
318 | ||||
|
319 | return effects | |||
|
320 | ||||
308 | def getobsoleted(repo, tr): |
|
321 | def getobsoleted(repo, tr): | |
309 | """return the set of pre-existing revisions obsoleted by a transaction""" |
|
322 | """return the set of pre-existing revisions obsoleted by a transaction""" | |
310 | torev = repo.unfiltered().changelog.nodemap.get |
|
323 | torev = repo.unfiltered().changelog.nodemap.get |
General Comments 0
You need to be logged in to leave comments.
Login now