18
18
"""Bazaar-NG -- a free distributed version-control tool
19
19
http://bazaar-ng.org/
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
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
43
'bzr help commands' for all commands.
50
def help(topic=None, outfile = None):
54
outfile.write(global_help)
63
55
elif topic == 'commands':
56
help_commands(outfile = outfile)
66
help_on_command(topic)
58
help_on_command(topic, outfile = outfile)
69
61
def command_usage(cmdname, cmdclass):
100
95
raise NotImplementedError("sorry, no detailed help yet for %r" % cmdname)
103
short, rest = doc.split('\n', 1)
108
print 'usage:', command_usage(topic, cmdclass)
97
outfile.write('usage: ' + command_usage(topic, cmdclass) + '\n')
110
99
if cmdclass.aliases:
111
print 'aliases: ' + ', '.join(cmdclass.aliases)
116
help_on_option(cmdclass.takes_options)
119
def help_on_option(options):
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):
118
outfile.write('\noptions:\n')
127
119
for on in options:
129
121
for shortname, longname in commands.SHORT_OPTIONS.items():
130
122
if longname == on:
131
123
l += ', -' + shortname
125
outfile.write(l + '\n')
128
def help_commands(outfile = None):
137
129
"""List all commands"""
142
137
for cmdname, cmdclass in commands.get_all_cmds():
145
140
for cmdname, cmdclass in accu:
146
141
if cmdclass.hidden:
148
print command_usage(cmdname, cmdclass)
143
outfile.write(command_usage(cmdname, cmdclass) + '\n')
149
144
help = inspect.getdoc(cmdclass)
151
print " " + help.split('\n', 1)[0]
146
outfile.write(" " + help.split('\n', 1)[0] + '\n')