##// END OF EJS Templates
debugformat: add a 'debugformat' command...
Boris Feld -
r35337:c3e4f196 default
parent child Browse files
Show More
@@ -859,6 +859,38 b' def debugfileset(ui, repo, expr, **opts)'
859 859 for f in ctx.getfileset(expr):
860 860 ui.write("%s\n" % f)
861 861
862 @command('debugformat',
863 [] + cmdutil.formatteropts,
864 _(''))
865 def debugformat(ui, repo, **opts):
866 """display format information about the current repository"""
867 maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant)
868 maxvariantlength = max(len('format-variant'), maxvariantlength)
869
870 def makeformatname(name):
871 return '%s:' + (' ' * (maxvariantlength - len(name)))
872
873 def formatvalue(value):
874 if value:
875 return 'yes'
876 else:
877 return 'no'
878
879 fm = ui.formatter('debugformat', opts)
880 fm.plain('format-variant')
881 fm.plain(' ' * (maxvariantlength - len('format-variant')))
882 fm.plain(' repo')
883 fm.plain('\n')
884 fm.startitem()
885 for fv in upgrade.allformatvariant:
886 repovalue = fv.fromrepo(repo)
887
888 fm.write('name', makeformatname(fv.name), fv.name,
889 label='formatvariant.name')
890 fm.write('repo', ' %3s', formatvalue(repovalue),
891 label='formatvariant.repo')
892 fm.plain('\n')
893
862 894 @command('debugfsinfo', [], _('[PATH]'), norepo=True)
863 895 def debugfsinfo(ui, path="."):
864 896 """show information detected about current filesystem"""
@@ -87,6 +87,7 b' Show debug commands if there are no othe'
87 87 debugdiscovery
88 88 debugextensions
89 89 debugfileset
90 debugformat
90 91 debugfsinfo
91 92 debuggetbundle
92 93 debugignore
@@ -264,6 +265,7 b' Show all commands + options'
264 265 debugdiscovery: old, nonheads, rev, ssh, remotecmd, insecure
265 266 debugextensions: template
266 267 debugfileset: rev
268 debugformat: template
267 269 debugfsinfo:
268 270 debuggetbundle: head, common, type
269 271 debugignore:
@@ -922,6 +922,7 b' Test list of internal help commands'
922 922 debugextensions
923 923 show information about active extensions
924 924 debugfileset parse and apply a fileset specification
925 debugformat display format information about the current repository
925 926 debugfsinfo show information detected about current filesystem
926 927 debuggetbundle
927 928 retrieves a bundle from a repo
@@ -54,6 +54,12 b' An upgrade of a repository created with '
54 54
55 55 $ hg init empty
56 56 $ cd empty
57 $ hg debugformat
58 format-variant repo
59 fncache: yes
60 dotencode: yes
61 generaldelta: yes
62 plain-cl-delta: yes
57 63 $ hg debugupgraderepo
58 64 (no feature deficiencies found in existing repository)
59 65 performing an upgrade with "--run" will make the following changes:
@@ -101,6 +107,12 b' Various sub-optimal detections work'
101 107 > store
102 108 > EOF
103 109
110 $ hg debugformat
111 format-variant repo
112 fncache: no
113 dotencode: no
114 generaldelta: no
115 plain-cl-delta: yes
104 116 $ hg debugupgraderepo
105 117 repository lacks features recommended by current config options:
106 118
General Comments 0
You need to be logged in to leave comments. Login now