comparison mercurial/commands.py @ 30881:1be65deb3d54

smartset: move set classes and related functions from revset module (API) These classes are pretty large and independent from revset computation. 2961 mercurial/revset.py 973 mercurial/smartset.py 3934 total revset.prettyformatset() is renamed to smartset.prettyformat(). Smartset classes are aliased since they are quite common in revset.py.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 16 Oct 2016 17:28:51 +0900
parents f36eec4b5a49
children 441705506d24
comparison
equal deleted inserted replaced
30880:b6c051cd1231 30881:1be65deb3d54
57 repair, 57 repair,
58 revlog, 58 revlog,
59 revset, 59 revset,
60 scmutil, 60 scmutil,
61 server, 61 server,
62 smartset,
62 sshserver, 63 sshserver,
63 sslutil, 64 sslutil,
64 streamclone, 65 streamclone,
65 templatekw, 66 templatekw,
66 templater, 67 templater,
2802 2803
2803 if opts['verify_optimized']: 2804 if opts['verify_optimized']:
2804 arevs = revset.makematcher(treebystage['analyzed'])(repo) 2805 arevs = revset.makematcher(treebystage['analyzed'])(repo)
2805 brevs = revset.makematcher(treebystage['optimized'])(repo) 2806 brevs = revset.makematcher(treebystage['optimized'])(repo)
2806 if ui.verbose: 2807 if ui.verbose:
2807 ui.note(("* analyzed set:\n"), revset.prettyformatset(arevs), "\n") 2808 ui.note(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n")
2808 ui.note(("* optimized set:\n"), revset.prettyformatset(brevs), "\n") 2809 ui.note(("* optimized set:\n"), smartset.prettyformat(brevs), "\n")
2809 arevs = list(arevs) 2810 arevs = list(arevs)
2810 brevs = list(brevs) 2811 brevs = list(brevs)
2811 if arevs == brevs: 2812 if arevs == brevs:
2812 return 0 2813 return 0
2813 ui.write(('--- analyzed\n'), label='diff.file_a') 2814 ui.write(('--- analyzed\n'), label='diff.file_a')
2826 return 1 2827 return 1
2827 2828
2828 func = revset.makematcher(tree) 2829 func = revset.makematcher(tree)
2829 revs = func(repo) 2830 revs = func(repo)
2830 if ui.verbose: 2831 if ui.verbose:
2831 ui.note(("* set:\n"), revset.prettyformatset(revs), "\n") 2832 ui.note(("* set:\n"), smartset.prettyformat(revs), "\n")
2832 for c in revs: 2833 for c in revs:
2833 ui.write("%s\n" % c) 2834 ui.write("%s\n" % c)
2834 2835
2835 @command('debugsetparents', [], _('REV1 [REV2]')) 2836 @command('debugsetparents', [], _('REV1 [REV2]'))
2836 def debugsetparents(ui, repo, rev1, rev2=None): 2837 def debugsetparents(ui, repo, rev1, rev2=None):