Next: Workspace, Previous: Global and Common Options, Up: Command Reference [Contents][Index]
mtn checkout [--[no-]move-conflicting-paths] --revision=id directory
mtn checkout [--[no-]move-conflicting-paths] --branch=branchname directory
mtn co
co
is an alias for checkout
. See Selectors.
These commands copy a revision id out of your database, recording the chosen revision (the base revision) in the file directory/_MTN/revision. These commands then copy every file version listed in the revision’s manifest to paths under directory.
For example, if the revision’s manifest contains these entries:
dir "" file "Makefile" content [84e2c30a2571bd627918deee1e6613d34e64a29e] file "include/hello.h" content [c61af2e67eb9b81e46357bb3c409a9a53a7cdfc6] file "src/hello.c" content [97dfc6fd4f486df95868d85b4b81197014ae2a84]
Then the following files are created:
directory/ directory/Makefile directory/include/hello.h directory/src/hello.c
If you wish to checkout
in the current directory, you can
supply the special name . (a single period) for
directory. When running checkout
into an existing
directory, it is sometimes possible for Workspace Collisions to
occur.
If no id is provided, as in the latter two commands, you must provide a branchname; monotone will attempt to infer id as the unique head of branchname if it exists.
mtn conflicts
See Conflicts
mtn explicit_merge [--[no-]update] id id destbranch
See the online help for options. See --update. See Selectors.
This command merges exactly the two revision ids you give it, and places
the result in branch destbranch. It is useful when you need more
control over the merging process than propagate
or merge
give you. For instance, if you have a branch with three heads, and you
only want to merge two of them, you can use this command. Or if you
have a branch with two heads, and you want to propagate one of them to
another branch, again, you can use this command.
Merge Conflicts can occur.
mtn heads [--branch=branchname]
This command lists the “heads” of branchname (defaults to the current workspace).
The “heads” of a branch is the set of revisions which are members of the branch, but which have no descendants. These revisions are generally the “newest” revisions committed by you or your colleagues, at least in terms of ancestry. The heads of a branch may not be the newest revisions, in terms of time, but synchronization of computer clocks is not reliable, so monotone usually ignores time.
mtn import --branch=branch [--message=message] [--[no-]dry-run] dir
mtn import --revision=revision [--message=message] [--[no-]dry-run] dir
See the online help for more options. See Selectors.
This command imports the contents of the given directory and commits it to the head of the given branch or as a child of the given revision (and consequently into the branch that revision resides in).
If the given branch doesn’t exist, it is created automatically. If the branch already exists, any missing files are dropped and any unknown files are added before committing.
If neither --message nor --message-file is given,
the Lua hook edit_comment
is called to provide a commit
comment, with text formatted as in mtn commit
.
If --dry-run is given, no commit is done.
Roughly speaking, mtn import
does the following:
$ mtn setup (with a twist)
$ mtn drop --missing
$ mtn add --unknown
$ mtn commit
The twist with the mtn setup
part is that it sets the parent
to be the given revision or the head of the given branch instead of the
null revision.
mtn merge [--branch=branchname] [--message string] [--message-file filename] [--[no-]update] [--resolve-conflicts]
See the online help for more options. See --update.
This command merges the “heads” of branchname (default the branch of the current workspace), if there are multiple heads, and commits the results to the database, marking the resulting merged revision as a member of branchname. The merged revision will contain each of the head revision IDs as ancestors.
A commit message may be provided via --message string or --message-file filename. A message stating the revision ids that were merged will be prepended to any user commit message.
Merging is performed by repeated pairwise merges: two heads are selected, then their least common ancestor is located in the ancestry graph and these 3 revisions are provided to the built-in 3-way merge algorithm. The process then repeats for each additional head, using the result of each previous merge as an input to the next.
Merge Conflicts for conflicts that can occur, and the use of
--resolve-conflicts
.
mtn merge_into_dir [--[no-]update] sourcebranch destbranch dir
This command takes a unique head from sourcebranch and merges it
into a unique head of destbranch, as a directory. The resulting
revision is committed to destbranch. If either sourcebranch or
destbranch has multiple heads, merge_into_dir
aborts, doing
nothing.
The purpose of merge_into_dir
is to permit a project to contain
another project in such a way that propagate
can be used to keep
the contained project up-to-date. It is meant to replace the use of nested
checkouts in many circumstances.
Note that merge_into_dir
does not permit changes made to the
contained project in destbranch to be propagated back to
sourcebranch. Attempting this would lead to sourcebranch containing
both projects nested as in destbranch instead of only the project
originally in sourcebranch, which is almost certainly not what would be
intended.
Merge Conflicts can occur. See --update.
mtn merge_into_workspace [--[no]-move-conflicting-paths] revision
Merges revision (see Selectors) into the current workspace; the result is not committed to the database. There can be no pending changes in the current workspace. The workspace’s selected branch is not changed.
When a later commit is done, both revision and the workspace’s base revision will be recorded as parents.
Merge Conflicts and Workspace Collisions can occur.
mtn migrate_workspace [directory]
Migrates a workspace directory’s metadata to the latest format.
If no directory is given, defaults to the current workspace.
This may be needed when upgrading to a new version of monotone.
mtn propagate sourcebranch destbranch [--message string] [--message-file filename]
See online help for more options. See Common Options.
This command takes a unique head from sourcebranch and merges it
with a unique head of destbranch, using the least common
ancestor of the two heads for a 3-way merge. The resulting revision is
committed to destbranch. If
either sourcebranch or destbranch has multiple heads,
propagate
aborts, doing nothing.
A commit message may be provided via --message string or --message-file filename. A message stating the source and target branches will be prepended to any user commit message.
The purpose of propagate
is to copy all the changes on
sourcebranch, since the last propagate
, to
destbranch. This command supports the idea of making separate
branches for medium-length development activities, such as
maintenance branches for stable software releases, trivial bug fix
branches, public contribution branches, or branches devoted to the
development of a single module within a larger project.
Merge Conflicts can occur.
mtn refresh_inodeprints
This command puts the current workspace into Inodeprints mode, if it was not already, and forces a full inodeprints cache refresh. After running this command, you are guaranteed that your workspace is in inodeprints mode, and that the inodeprints cache is accurate and up to date.
mtn setup --branch branchname [--db database] [directory]
This command prepares directory (default current directory) as a monotone workspace, by creating and populating the _MTN directory with basic information.
If no database is given, the configured default database is created or re-used (see get_default_database_alias for more details). Both settings, branch and database name, will be placed in the _MTN/options file.
This can be used with an empty directory to start a new blank project,
or within an existing directory full of files, prior to using
mtn commit
.
On Windows, workspaces cannot be located in the root directory of a device; for example, d:/ is an invalid directory for a workspace.
• Conflicts: |
Next: Workspace, Previous: Global and Common Options, Up: Command Reference [Contents][Index]