Show More
@@ -108,17 +108,6 def setremoteconfig(ui, opts): | |||||
108 | if opts.get('remotecmd'): |
|
108 | if opts.get('remotecmd'): | |
109 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) |
|
109 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) | |
110 |
|
110 | |||
111 | def show_version(ui): |
|
|||
112 | """output version and copyright information""" |
|
|||
113 | ui.write(_("Mercurial Distributed SCM (version %s)\n") |
|
|||
114 | % version.get_version()) |
|
|||
115 | ui.status(_( |
|
|||
116 | "\nCopyright (C) 2005, 2006 Matt Mackall <mpm@selenic.com>\n" |
|
|||
117 | "This is free software; see the source for copying conditions. " |
|
|||
118 | "There is NO\nwarranty; " |
|
|||
119 | "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" |
|
|||
120 | )) |
|
|||
121 |
|
||||
122 | def help_(ui, name=None, with_version=False): |
|
111 | def help_(ui, name=None, with_version=False): | |
123 | """show help for a command, extension, or list of commands |
|
112 | """show help for a command, extension, or list of commands | |
124 |
|
113 | |||
@@ -132,7 +121,7 def help_(ui, name=None, with_version=Fa | |||||
132 |
|
121 | |||
133 | def helpcmd(name): |
|
122 | def helpcmd(name): | |
134 | if with_version: |
|
123 | if with_version: | |
135 |
|
|
124 | version_(ui) | |
136 | ui.write('\n') |
|
125 | ui.write('\n') | |
137 | aliases, i = findcmd(ui, name) |
|
126 | aliases, i = findcmd(ui, name) | |
138 | # synopsis |
|
127 | # synopsis | |
@@ -213,7 +202,7 def help_(ui, name=None, with_version=Fa | |||||
213 | else: |
|
202 | else: | |
214 | # program name |
|
203 | # program name | |
215 | if ui.verbose or with_version: |
|
204 | if ui.verbose or with_version: | |
216 |
|
|
205 | version_(ui) | |
217 | else: |
|
206 | else: | |
218 | ui.status(_("Mercurial Distributed SCM\n")) |
|
207 | ui.status(_("Mercurial Distributed SCM\n")) | |
219 | ui.status('\n') |
|
208 | ui.status('\n') | |
@@ -2380,6 +2369,17 def verify(ui, repo): | |||||
2380 | """ |
|
2369 | """ | |
2381 | return hg.verify(repo) |
|
2370 | return hg.verify(repo) | |
2382 |
|
2371 | |||
|
2372 | def version_(ui): | |||
|
2373 | """output version and copyright information""" | |||
|
2374 | ui.write(_("Mercurial Distributed SCM (version %s)\n") | |||
|
2375 | % version.get_version()) | |||
|
2376 | ui.status(_( | |||
|
2377 | "\nCopyright (C) 2005, 2006 Matt Mackall <mpm@selenic.com>\n" | |||
|
2378 | "This is free software; see the source for copying conditions. " | |||
|
2379 | "There is NO\nwarranty; " | |||
|
2380 | "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" | |||
|
2381 | )) | |||
|
2382 | ||||
2383 | # Command options and aliases are listed here, alphabetically |
|
2383 | # Command options and aliases are listed here, alphabetically | |
2384 |
|
2384 | |||
2385 | globalopts = [ |
|
2385 | globalopts = [ | |
@@ -2759,7 +2759,7 table = { | |||||
2759 | ('f', 'force', None, _('force a merge with outstanding changes'))], |
|
2759 | ('f', 'force', None, _('force a merge with outstanding changes'))], | |
2760 | _('hg update [-C] [-f] [REV]')), |
|
2760 | _('hg update [-C] [-f] [REV]')), | |
2761 | "verify": (verify, [], _('hg verify')), |
|
2761 | "verify": (verify, [], _('hg verify')), | |
2762 |
"version": ( |
|
2762 | "version": (version_, [], _('hg version')), | |
2763 | } |
|
2763 | } | |
2764 |
|
2764 | |||
2765 | norepo = ("clone init version help debugancestor debugcomplete debugdata" |
|
2765 | norepo = ("clone init version help debugancestor debugcomplete debugdata" | |
@@ -2981,7 +2981,7 def dispatch(args): | |||||
2981 | if options['help']: |
|
2981 | if options['help']: | |
2982 | return help_(u, cmd, options['version']) |
|
2982 | return help_(u, cmd, options['version']) | |
2983 | elif options['version']: |
|
2983 | elif options['version']: | |
2984 |
return |
|
2984 | return version_(u) | |
2985 | elif not cmd: |
|
2985 | elif not cmd: | |
2986 | return help_(u, 'shortlist') |
|
2986 | return help_(u, 'shortlist') | |
2987 |
|
2987 |
General Comments 0
You need to be logged in to leave comments.
Login now