30
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
37
Show software version/licence/non-warranty.
39
Start versioning the current directory
43
Show revision history.
46
bzr move FROM... DESTDIR
47
Move one or more files to a different directory.
49
Show changes from last revision to working copy.
50
bzr commit -m 'MESSAGE'
51
Store current state as new revision.
52
bzr export [-r REVNO] DESTINATION
53
Export the branch state at a previous version.
55
Show summary of pending changes.
57
Make a file not versioned.
59
Show statistics about this branch.
61
Verify history is stored safely.
62
(for more type 'bzr help commands')
62
def help(topic=None, outfile = None):
66
outfile.write(global_help)
67
69
elif topic == 'commands':
68
help_commands(outfile = outfile)
70
help_on_command(topic, outfile = outfile)
73
def command_usage(cmdname, cmdclass):
74
"""Return single-line grammar for command.
76
Only describes arguments, not options.
72
help_on_command(topic)
75
def help_on_command(cmdname):
76
cmdname = str(cmdname)
78
from inspect import getdoc
80
topic, cmdclass = commands.get_cmd_class(cmdname)
82
doc = getdoc(cmdclass)
84
raise NotImplementedError("sorry, no detailed help yet for %r" % cmdname)
87
short, rest = doc.split('\n', 1)
92
print 'usage: bzr ' + topic,
79
93
for aname in cmdclass.takes_args:
80
94
aname = aname.upper()
81
95
if aname[-1] in ['$', '+']:
84
98
aname = '[' + aname[:-1] + ']'
85
99
elif aname[-1] == '*':
86
100
aname = '[' + aname[:-1] + '...]'
95
def help_on_command(cmdname, outfile = None):
96
cmdname = str(cmdname)
101
from inspect import getdoc
103
topic, cmdclass = commands.get_cmd_class(cmdname)
105
doc = getdoc(cmdclass)
107
raise NotImplementedError("sorry, no detailed help yet for %r" % cmdname)
109
outfile.write('usage: ' + command_usage(topic, cmdclass) + '\n')
111
105
if cmdclass.aliases:
112
outfile.write('aliases: ' + ', '.join(cmdclass.aliases) + '\n')
118
help_on_option(cmdclass.takes_options, outfile = None)
121
def help_on_option(options, outfile = None):
106
print 'aliases: ' + ', '.join(cmdclass.aliases)
111
help_on_option(cmdclass.takes_options)
114
def help_on_option(options):
130
outfile.write('\noptions:\n')
131
122
for on in options:
133
124
for shortname, longname in commands.SHORT_OPTIONS.items():
134
125
if longname == on:
135
126
l += ', -' + shortname
137
outfile.write(l + '\n')
140
def help_commands(outfile = None):
141
132
"""List all commands"""
149
137
for cmdname, cmdclass in commands.get_all_cmds():