106 if opts.get('ssh'): |
106 if opts.get('ssh'): |
107 ui.setconfig("ui", "ssh", opts['ssh']) |
107 ui.setconfig("ui", "ssh", opts['ssh']) |
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 |
125 With no arguments, print a list of commands and short help. |
114 With no arguments, print a list of commands and short help. |
126 |
115 |
2377 integrity, validating the hashes and checksums of each entry in |
2366 integrity, validating the hashes and checksums of each entry in |
2378 the changelog, manifest, and tracked files, as well as the |
2367 the changelog, manifest, and tracked files, as well as the |
2379 integrity of their crosslinks and indices. |
2368 integrity of their crosslinks and indices. |
2380 """ |
2369 """ |
2381 return hg.verify(repo) |
2370 return hg.verify(repo) |
|
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 |
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 = [ |
2386 ('R', 'repository', '', |
2386 ('R', 'repository', '', |
2757 ('m', 'merge', None, _('allow merging of branches (DEPRECATED)')), |
2757 ('m', 'merge', None, _('allow merging of branches (DEPRECATED)')), |
2758 ('C', 'clean', None, _('overwrite locally modified files')), |
2758 ('C', 'clean', None, _('overwrite locally modified files')), |
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": (show_version, [], _('hg 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" |
2766 " debugindex debugindexdot") |
2766 " debugindex debugindexdot") |
2767 optionalrepo = ("paths serve showconfig") |
2767 optionalrepo = ("paths serve showconfig") |
2979 raise util.Abort(_("repository '%s' is not local") % path) |
2979 raise util.Abort(_("repository '%s' is not local") % path) |
2980 |
2980 |
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 show_version(u) |
2984 return version_(u) |
2985 elif not cmd: |
2985 elif not cmd: |
2986 return help_(u, 'shortlist') |
2986 return help_(u, 'shortlist') |
2987 |
2987 |
2988 if cmd not in norepo.split(): |
2988 if cmd not in norepo.split(): |
2989 try: |
2989 try: |