Next: Review, Previous: Network, Up: Command Reference [Contents][Index]
mtn annotate file
mtn annotate [--revision=id] [--revs-only] file
See Selectors.
Dumps an annotated copy of the file to stdout. The output is in the form:
<short revision id>.. by <author> <date>: <line>
<revision id> is the revision in which that line of the file was last edited; <author> is the author cert on that revision, <date> is the date cert on that revision.
Only the first 8 characters of the revision id are displayed, the
author cert value is truncated at the first @
or space
character and the date field is truncated to remove the time of day.
If --revs-only is specified, the output format is:
<revision id>: <line>
mtn bisect bad [--revision=id ...] [--[no-]move-conflicting-paths]
Mark the specified revisions as “bad” for the current bisection operation (see Bisecting, see Selectors). If no bisection operation is in progress a new bisection is initialized. If a bisection operation is in progress the next update target is selected and the workspace is updated to the selected revision.
If the update is blocked by conflicting unversioned paths existing in
the workspace this command may be re-issued with the
--move-conflicting-paths option. Alternatively, the
bisect update
command can be used with this option to update
the workspace and move the conflicting paths out of the way.
mtn bisect good [--revision=id ...] [--[no-]move-conflicting-paths]
Mark the specified revisions as “good” for the current bisection operation (see Bisecting, see Selectors). If no bisection operation is in progress a new bisection is initialized. If a bisection operation is in progress the next update target is selected and the workspace is updated to the selected revision.
If the update is blocked by conflicting unversioned paths existing in
the workspace this command may be re-issued with the
--move-conflicting-paths option. Alternatively, the
bisect update
command can be used with this option to update
the workspace and move the conflicting paths out of the way.
mtn bisect reset
Reset the current bisection operation by updating the workspace back to the revision from which the bisection was started and clearing the current bisection information.
mtn bisect skip [--revision=id ...] [--[no-]move-conflicting-paths]
Mark the specified revisions as “skipped” for the current bisection operation (see Bisecting, see Selectors). If no bisection operation is in progress a new bisection is initialized. If a bisection operation is in progress the next update target is selected and the workspace is updated to the selected revision.
If the update is blocked by conflicting unversioned paths existing in
the workspace this command may be re-issued with the
--move-conflicting-paths option. Alternatively, the
bisect update
command can be used with this option to update
the workspace and move the conflicting paths out of the way.
mtn bisect status
Report the status of the current bisection operation including the number of revisions that remain to be tested, the number of revisions that have been tested and the next revision that will selected for testing.
mtn bisect update [--[no-]move-conflicting-paths]
Update the workspace to the next revision selected by the previous bisect operation (see Bisecting). This command can be useful when the previous bisect operation fails to update the workspace because of conflicting unversioned paths existing in the workspace.
mtn cat [--revision=id] path
Write the contents of a specific file path in revision id (see Selectors; default to workspace base revision) to standard output.
mtn complete file partial-id
mtn complete key partial-id
mtn complete revision partial-id
These commands print out all known completions of a partial SHA1
value (not a selector), listing completions which are
file
, manifest
or revision
IDs depending on which
variant is used. For example, suppose you enter this command and get
this result:
$ mtn complete revision fa36 fa36deead87811b0e15208da2853c39d2f6ebe90 fa36b76dd0139177b28b379fe1d56b22342e5306 fa36965ec190bee14c5afcac235f1b8e2239bb2a
Then monotone is telling you that there are 3 revisions it knows
about, in its database, which begin with the 4 hex digits
fa36
. This command is intended to be used by programmable
completion systems, such as those in bash
and zsh
.
mtn diff [--unified] [--[no-]show-encloser]
mtn diff --context [--[no-]show-encloser]
mtn diff --external [--diff-args=argstring]
mtn diff pathname...
mtn diff [--reverse] --revision=id
mtn diff --revision=id pathname...
mtn diff --revision=id1 --revision=id2
mtn diff --revision=id1 --revision=id2 pathname...
mtn di
di
is an alias for diff
. See online help for more
options. See Selectors.
These commands print out textual difference listings between various
manifest versions. With no --revision options, diff
will print the difference from the base revision to the current
revision in the workspace.
With one --revision option, diff
will print the
difference from the revision id to the current revision in the
workspace. If --reverse is given, the order of the diff is
reversed.
With two --revision options diff
will print the
difference from revision id1 to id2, ignoring any
workspace.
In all cases, monotone will print a textual summary – identical to
the summary presented by mtn status
– of the logical
differences between revisions in lines proceeding the diff. These
lines begin with a single hash mark #
, and should be ignored by
a program processing the diff, such as patch
.
Specifying pathnames to the diff
command restricts the set of
changes that are visible and results in only a partial diff between
two revisions. Changes to files not included in the specified set of
pathnames will be ignored.
From within a subdirectory of the workspace the diff
command
will, by default, include all changes in the workspace.
Specifying only the pathname "." will restrict diff
to files
changed within the current subdirectory of the workspace.
The output format of diff
is controlled by the options
--unified, --context, --no-show-encloser, and
--external. By default, monotone uses its built-in diff
algorithm to produce a listing in “unified diff” format (analogous
to running the program diff -u
); you can also explicitly
request this with --unified. The built-in diff algorithm can
also produce “context diff” format (analogous to diff -c
),
which you request by specifying --context. The short options
that diff
accepts for these modes, -u and
-c, also work.
In either of these modes, monotone prints the name of the top-level
code construct that encloses each “hunk” of changes, unless
suppressed with the --no-show-encloser. The options that
diff
accepts for this mode, -p and
--show-c-function, also work. Monotone finds the enclosing
construct by scanning backward from the first changed line in each
hunk for a line that matches a regular expression. The default
regular expression is correct for many programming languages. You can
adjust the expression used with the Lua hook
get_encloser_pattern. For the regular expression syntax, see
Regexps.
Sometimes, you may want more flexibility in output formats; for these
cases, you can use --external, which causes monotone to
invoke an external program to generate the actual output. By default,
the external program is diff
, and you can use the option
--diff-args to pass additional arguments controlling
formatting. The actual invocation of diff
, default
arguments passed to it, and so on, are controlled by the hook
external_diff.
mtn help [--[no-]hidden] command...
Displays help about commands and options.
mtn list branches [pattern] [--exclude=pattern]
mtn ls branches
ls branches
is an alias for list branches
.
This command lists all known branches in your database. If pattern is provided, it is used as a glob to select the branches listed, otherwise all branches are listed. If -exclude options are provided they are used as globs to exclude specified branches. In addition, branches for which the Lua hook ignore_branch returns true are excluded.
Normally, branches that have been suspended are not listed; the global
option --ignore-suspend-certs causes suspended branches to
be listed; see mtn suspend
.
mtn list certs id
mtn ls certs
ls certs
is an alias for list certs
.
This command will print out a list of certificates associated with a particular revision id. Each line of the print out will indicate:
ok
or bad
For example, this command lists the certificates associated with a particular version of monotone itself, in the monotone development branch:
$ mtn list certs 4a96 mtn: expanding partial id '4a96' mtn: expanded to '4a96a230293456baa9c6e7167cafb3c5b52a8e7f' ----------------------------------------------------------------- Key : graydon@pobox.com (10b5b36b4a...) Sig : ok Name : author Value : graydon@dub.venge.net ----------------------------------------------------------------- Key : graydon@pobox.com (10b5b36b4a...) Sig : ok Name : branch Value : monotone ----------------------------------------------------------------- Key : graydon@pobox.com (10b5b36b4a...) Sig : ok Name : date Value : 2003-10-17T03:20:27 ----------------------------------------------------------------- Key : graydon@pobox.com (10b5b36b4a...) Sig : ok Name : changelog Value : 2003-10-16 graydon hoare <graydon@pobox.com> : : * sanity.hh: Add a const version of idx(). : * diff_patch.cc: Change to using idx() everywhere. : * cert.cc (find_common_ancestor): Rewrite to recursive : form, stepping over historic merges. : * tests/t_cross.at: New test for merging merges. : * testsuite.at: Call t_cross.at. :
mtn list changed [pathname...]
mtn ls changed
ls changed
is an alias for list changed
.
See online help for more options.
This command lists all files in your workspace that have changed compared to the base revision, including files that are dropped, added or renamed.
Specifying pathnames to the list changed
command restricts
the set of paths that are checked for changes. Files not included in the
specified set of pathnames will not be listed.
From within a subdirectory of the workspace the list
changed
command will, by default, search the entire workspace.
Specifying only the pathname "." will restrict the search for known
files to the current subdirectory of the workspace.
mtn list databases
mtn list dbs
mtn ls databases
mtn ls dbs
Show all Managed Databases and the workspaces registered in
them. The commands mtn register_workspace
and
mtn unregister_workspace
can be used to explicitely
register and unregister workspaces shown within this list.
mtn list duplicates [--revision=id]
mtn ls duplicates
ls duplicates
is an alias for list duplicates
. See
Selectors.
This command lists duplicate files in a given revision (defaults to the workspace base revision). Ignored and unknown files are excluded from the listing.
Two or more files are considered duplicates if the SHA1 hashes of their contents are equal.
mtn list ignored [--[no-]recursive] [pathname...]
mtn ls ignored
ls ignored
is an alias for list ignored
.
This command lists all files in your workspace that monotone is intentionally ignoring, due to the results of the ignore_file hook.
Specifying pathnames to the list ignored
command restricts the
set of paths that are searched for ignored files. Ignored files not
included in the specified set of pathnames will not be listed.
From within a subdirectory of the workspace the list
ignored
command will, by default, search the entire workspace.
Specifying only the pathname "." will restrict the search for ignored
files to the current subdirectory of the workspace.
Default is --recursive; all directories will be traversed. Specifying --no-recursive restricts the listing to the root directory of the specified path (or the workspace, if no path is given).
mtn list keys [pattern]
mtn ls keys
ls keys
is an alias for list keys
.
These commands list RSA keys held in your keystore and current database. They do not print out any cryptographic information; they simply list the names of public and private keys you have on hand.
If pattern is provided, it is used as a glob to limit the keys listed. Otherwise all keys in your database are listed.
mtn list known [pathname...]
mtn ls known
ls known
is an alias for list known
.
This command lists all files which would become part of the manifest of the next revision if you committed your workspace at this point.
Specifying pathnames to the list known
command restricts
the set of paths that are searched for manifest files. Files not
included in the specified set of pathnames will not be listed.
From within a subdirectory of the workspace the list
known
command will, by default, search the entire workspace.
Specifying only the pathname "." will restrict the search for known
files to the current subdirectory of the workspace.
mtn list missing [pathname...]
mtn ls missing
ls missing
is an alias for list missing
.
This command lists all files in your workspace’s base manifest, which are not present in the workspace.
Specifying pathnames to the list missing
command restricts the
set of paths that are searched for missing files. Missing files not
included in the specified set of pathnames will not be listed.
From within a subdirectory of the workspace the list
missing
command will, by default, search the entire workspace.
Specifying only the pathname "." will restrict the search for missing
files to the current subdirectory of the workspace.
mtn list tags [pattern] [--exclude=pattern]
mtn ls tags
ls tags
is an alias for list tags
.
This command lists all known tags in your database that match the given pattern (default all tags). If --exclude options are provided they are used as globs to exclude specified tags.
mtn list unknown [--[no-]recursive] [pathname...]
mtn ls unknown
ls unknown
is an alias for list unknown
.
This command lists all files in your workspace that monotone knows nothing about.
Specifying pathnames to the list unknown
command restricts the
set of paths that are searched for unknown files. Unknown files not
included in the specified set of pathnames will not be listed.
From within a subdirectory of the workspace the list
unknown
command will, by default, search the entire workspace.
Specifying only the pathname "." will restrict the search for unknown
files to the current subdirectory of the workspace.
Default is --recursive; all directories will be traversed. Specifying --no-recursive restricts the listing to the root directory of the specified path (or the workspace, if no path is given).
mtn list vars [domain]
mtn ls vars
ls vars
is an alias for list vars
.
This command lists all vars in your database, or all vars within a given domain. See Vars for more information.
mtn list workspaces
mtn ls workspaces
ls workspaces
is an alias for list workspaces
.
This command shows all registered workspaces for a database, be it
managed or unmanaged. If no database is given explicitely, defaults to
the workspace’ database in which the command is executed. The commands
mtn register_workspace
and mtn unregister_workspace
can be used to explicitely register and unregister workspaces shown
within this list. See Managed Databases for more information.
mtn log
mtn log [--last=n] [--next=n] [--from=id [...]] [--clear-from] [--to=id [...]] [--clear-to] [--revision=id [...]] [--[no-]brief] [--[no-]merges] [--[no-]files] [--[no-]graph] [--[no-]diffs] [pathname...]
See the online help for more options. See Selectors.
This command prints out a log, in forward ancestry order by default but optionally in reverse ancestry order, of small history summaries. Each summary contains author, date, branch, changelog and comment information associated with a revision.
If --brief is given, the output consists of two lines per revision with the revision ID, the author, the date and the branches (separated with commas). If the --no-graph option is also given the output contains only one line per revision.
If --last=n is given, at most n log entries will be given and log will trace through history in reverse-ancestry order, from newer revisions to older revisions.
If --next=n is given, at most n log entries will
be given and log will trace through history in forward-ancestry order,
from older revisions to newer revisions. This is useful to review
changes that will be applied to the workspace when update
is
run.
If --from=id is given, log starts tracing through history from the specified revisions, otherwise it starts from the base revision of your workspace. Log will stop when it reaches the end of the revision history or revisions specified by the --to option.
--clear-from erases the effect of all previous --from options. --clear-to erases the effect of all previous --to options.
When tracing through history in reverse-ancestry order and --to=id is given, log will stop when it reaches the specified revisions or any of their ancestors or the end of the revision history. When tracing through history in forward-ancestry order log will stop when it reaches the specified revisions or any of their descendants or the end of the revision history.
If --revision=id is given, log will print only the specified revisions.
If both --from and --revision are given only revisions included by both options will be logged. Revisions specified by --revision that are beyond the starting points specified by --from will be excluded.
Additionally, each of the --from, --to and --revision options accept selectors, see Selectors. These can be used in various ways to log interesting revisions. For example:
$ mtn log --revision b: $ mtn log --revision today $ mtn log --revision bob
will log all revisions from the current branch, all revisions dated today and all revisions with bob as the author, respectively.
By default, the log entries for merge nodes are shown. If --no-merges is given, the log entries for these nodes will be excluded.
If --no-files is given, the log output excludes the list of files changed in each revision.
If --no-graph is given, the log output excludes the ASCII revision graph prefix on log output lines.
Specifying --diffs causes the log output to include a unified diff of the changes in each revision.
If one or more files are given, the command will only log the revisions where those files are changed.
mtn manpage [--formatted/--plain] [--[no-]hidden]
The manpage command generates a complete (and if monotone is available in your language, also localized) manual page for all available commands, including all user-defined Lua commands.
The default for --formatted/--plain depends on whether
mtn manpage
is run from a terminal, or from a shell
script. From a terminal, the default is --formatted; from a
script, it is --plain.
If --formatted, the output is formatted and displayed using
the command given by the Lua hook
get_man_page_formatter_command
(defaults to
nroff | less
).
If --plain, the output is nroff markup.
The option --hidden additionally enables the output of hidden commands and options, which is deactivated by default.
mtn show_conflicts rev rev
This command shows what conflicts would need to be resolved in order to merge the given revisions; see Merge Conflicts, see Selectors.
Note that this does not show conflicts due to update commands, since in that case one revision is the workspace.
mtn status [pathname...]
This command prints a description of the “status” of your workspace. In particular, it prints:
Specifying optional pathname... arguments to the status
command restricts the set of changes that are visible and results in
only a partial status of the workspace. Changes to files not included
in the specified set of pathnames will be ignored.
From within a subdirectory of the workspace the status
command
will, by default, include all changes in the workspace.
Specifying only the pathname "." will restrict status
to files
changed within the current subdirectory of the workspace.
mtn version [--full | --concise]
Shows the program version.
The concise version is one line, for example:
monotone 1.0dev (base revision: c91edf22b20f5a8b750a8a02af763412d6b936e8)
The full version gives more information, including a changelist of the monotone source tree from the base revision at the time the executable was compiled.
Next: Review, Previous: Network, Up: Command Reference [Contents][Index]