comparison hgext/evolve.py @ 1570:0edb2c25f806 stable

evolve: improve help for some debug commands
author Greg Ward <greg@gerg.ca>
date Sat, 07 Nov 2015 09:48:04 -0500
parents bd1468c23d88
children 0e8936e7cb89
comparison
equal deleted inserted replaced
1569:bd1468c23d88 1570:0edb2c25f806
1126 _deprecatealias('gup', 'next') 1126 _deprecatealias('gup', 'next')
1127 _deprecatealias('gdown', 'previous') 1127 _deprecatealias('gdown', 'previous')
1128 1128
1129 @command('debugrecordpruneparents', [], '') 1129 @command('debugrecordpruneparents', [], '')
1130 def cmddebugrecordpruneparents(ui, repo): 1130 def cmddebugrecordpruneparents(ui, repo):
1131 """add parents data to prune markers when possible 1131 """add parent data to prune markers when possible
1132 1132
1133 This commands search the repo for prune markers without parent information. 1133 This command searches the repo for prune markers without parent information.
1134 If the pruned node is locally known, a new markers with parent data is 1134 If the pruned node is locally known, it creates a new marker with parent
1135 created.""" 1135 data.
1136 """
1136 pgop = 'reading markers' 1137 pgop = 'reading markers'
1137 1138
1138 # lock from the beginning to prevent race 1139 # lock from the beginning to prevent race
1139 wlock = lock = tr = None 1140 wlock = lock = tr = None
1140 try: 1141 try:
1162 finally: 1163 finally:
1163 lockmod.release(tr, lock, wlock) 1164 lockmod.release(tr, lock, wlock)
1164 1165
1165 @command('debugobsstorestat', [], '') 1166 @command('debugobsstorestat', [], '')
1166 def cmddebugobsstorestat(ui, repo): 1167 def cmddebugobsstorestat(ui, repo):
1168 """print statistics about obsolescence markers in the repo"""
1167 def _updateclustermap(nodes, mark, clustersmap): 1169 def _updateclustermap(nodes, mark, clustersmap):
1168 c = (set(nodes), set([mark])) 1170 c = (set(nodes), set([mark]))
1169 toproceed = set(nodes) 1171 toproceed = set(nodes)
1170 while toproceed: 1172 while toproceed:
1171 n = toproceed.pop() 1173 n = toproceed.pop()
1179 continue 1181 continue
1180 clustersmap[on] = other 1182 clustersmap[on] = other
1181 c = other 1183 c = other
1182 clustersmap[n] = c 1184 clustersmap[n] = c
1183 1185
1184 """print statistic about obsolescence markers in the repo"""
1185 store = repo.obsstore 1186 store = repo.obsstore
1186 unfi = repo.unfiltered() 1187 unfi = repo.unfiltered()
1187 nm = unfi.changelog.nodemap 1188 nm = unfi.changelog.nodemap
1188 ui.write('markers total: %9i\n' % len(store._all)) 1189 ui.write('markers total: %9i\n' % len(store._all))
1189 sucscount = [0, 0 , 0, 0] 1190 sucscount = [0, 0 , 0, 0]