comparison mercurial/debugcommands.py @ 38261:f3033692ccef

stringutil: promote smartset.prettyformat() to utility function It will be used by debugwalk.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 10 Jun 2018 11:50:09 +0900
parents ead71b15efd5
children 7c3a59e2971b
comparison
equal deleted inserted replaced
38260:15a1e37f80bd 38261:f3033692ccef
68 revset, 68 revset,
69 revsetlang, 69 revsetlang,
70 scmutil, 70 scmutil,
71 setdiscovery, 71 setdiscovery,
72 simplemerge, 72 simplemerge,
73 smartset,
74 sshpeer, 73 sshpeer,
75 sslutil, 74 sslutil,
76 streamclone, 75 streamclone,
77 templater, 76 templater,
78 treediscovery, 77 treediscovery,
2234 2233
2235 if opts['verify_optimized']: 2234 if opts['verify_optimized']:
2236 arevs = revset.makematcher(treebystage['analyzed'])(repo) 2235 arevs = revset.makematcher(treebystage['analyzed'])(repo)
2237 brevs = revset.makematcher(treebystage['optimized'])(repo) 2236 brevs = revset.makematcher(treebystage['optimized'])(repo)
2238 if opts['show_set'] or (opts['show_set'] is None and ui.verbose): 2237 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2239 ui.write(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n") 2238 ui.write(("* analyzed set:\n"), stringutil.prettyrepr(arevs), "\n")
2240 ui.write(("* optimized set:\n"), smartset.prettyformat(brevs), "\n") 2239 ui.write(("* optimized set:\n"), stringutil.prettyrepr(brevs), "\n")
2241 arevs = list(arevs) 2240 arevs = list(arevs)
2242 brevs = list(brevs) 2241 brevs = list(brevs)
2243 if arevs == brevs: 2242 if arevs == brevs:
2244 return 0 2243 return 0
2245 ui.write(('--- analyzed\n'), label='diff.file_a') 2244 ui.write(('--- analyzed\n'), label='diff.file_a')
2258 return 1 2257 return 1
2259 2258
2260 func = revset.makematcher(tree) 2259 func = revset.makematcher(tree)
2261 revs = func(repo) 2260 revs = func(repo)
2262 if opts['show_set'] or (opts['show_set'] is None and ui.verbose): 2261 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2263 ui.write(("* set:\n"), smartset.prettyformat(revs), "\n") 2262 ui.write(("* set:\n"), stringutil.prettyrepr(revs), "\n")
2264 if not opts['show_revs']: 2263 if not opts['show_revs']:
2265 return 2264 return
2266 for c in revs: 2265 for c in revs:
2267 ui.write("%d\n" % c) 2266 ui.write("%d\n" % c)
2268 2267