18
18
"""Bazaar-NG -- a free distributed version-control tool
19
19
http://bazaar-ng.org/
21
WARNING: This is an unstable development version.
26
bzr init makes this branch versioned
27
bzr branch make a copy of another branch
29
bzr add make files or directories versioned
30
bzr ignore ignore a file or pattern
31
bzr mv move or rename a versioned file
33
bzr status summarize changes in working copy
34
bzr diff show detailed diffs
36
bzr merge pull in changes from another branch
39
bzr log show history of changes
40
bzr check validate storage
42
Use e.g. 'bzr help init' for more details, or 'bzr help commands' for
21
**WARNING: THIS IS AN UNSTABLE DEVELOPMENT VERSION**
23
* Metadata format is not stable yet -- you may need to
24
discard history in the future.
26
* Many commands unimplemented or partially implemented.
28
* Space-inefficient storage.
30
* No merge operators yet.
33
To make a branch, use 'bzr init' in an existing directory, then 'bzr
34
add' to make files versioned. 'bzr add .' will recursively add all
37
'bzr status' describes files that are unknown, ignored, or modified.
38
'bzr diff' shows the text changes to the tree or named files.
39
'bzr commit -m <MESSAGE>' commits all changes in that branch.
41
'bzr move' and 'bzr rename' allow you to rename files or directories.
42
'bzr remove' makes a file unversioned but keeps the working copy;
43
to delete that too simply delete the file.
45
'bzr log' shows a history of changes, and
46
'bzr info' gives summary statistical information.
47
'bzr check' validates all files are stored safely.
49
Files can be ignored by giving a path or a glob in .bzrignore at the
50
top of the tree. Use 'bzr ignored' to see what files are ignored and
51
why, and 'bzr unknowns' to see files that are neither versioned or
54
For more help on any command, type 'bzr help COMMAND', or 'bzr help
50
def help(topic=None, outfile = None):
54
outfile.write(global_help)
55
63
elif topic == 'commands':
56
help_commands(outfile = outfile)
58
help_on_command(topic, outfile = outfile)
66
help_on_command(topic)
61
69
def command_usage(cmdname, cmdclass):
95
100
raise NotImplementedError("sorry, no detailed help yet for %r" % cmdname)
97
outfile.write('usage: ' + command_usage(topic, cmdclass) + '\n')
102
print 'usage:', command_usage(topic, cmdclass)
99
104
if cmdclass.aliases:
100
outfile.write('aliases: ' + ', '.join(cmdclass.aliases) + '\n')
106
help_on_option(cmdclass.takes_options, outfile = None)
109
def help_on_option(options, outfile = None):
105
print 'aliases: ' + ', '.join(cmdclass.aliases)
109
help_on_option(cmdclass.takes_options)
112
def help_on_option(options):
118
outfile.write('\noptions:\n')
119
120
for on in options:
121
122
for shortname, longname in commands.SHORT_OPTIONS.items():
122
123
if longname == on:
123
124
l += ', -' + shortname
125
outfile.write(l + '\n')
128
def help_commands(outfile = None):
129
130
"""List all commands"""
137
135
for cmdname, cmdclass in commands.get_all_cmds():
140
138
for cmdname, cmdclass in accu:
141
139
if cmdclass.hidden:
143
outfile.write(command_usage(cmdname, cmdclass) + '\n')
141
print command_usage(cmdname, cmdclass)
144
142
help = inspect.getdoc(cmdclass)
146
outfile.write(" " + help.split('\n', 1)[0] + '\n')
144
print " " + help.split('\n', 1)[0]