/usr/share/doc/monotone/html/Workspace.html is in monotone-doc 1.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: Workspace</title>
<meta name="description" content="monotone documentation: Workspace">
<meta name="keywords" content="monotone documentation: Workspace">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="General-Index.html#General-Index" rel="index" title="General Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Command-Reference.html#Command-Reference" rel="up" title="Command Reference">
<link href="Network.html#Network" rel="next" title="Network">
<link href="Conflicts.html#Conflicts" rel="prev" title="Conflicts">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space: nowrap}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: serif; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="texinfo.css">
</head>
<body lang="en">
<a name="Workspace"></a>
<div class="header">
<p>
Next: <a href="Network.html#Network" accesskey="n" rel="next">Network</a>, Previous: <a href="Tree.html#Tree" accesskey="p" rel="prev">Tree</a>, Up: <a href="Command-Reference.html#Command-Reference" accesskey="u" rel="up">Command Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Workspace-1"></a>
<h3 class="section">4.3 Workspace</h3>
<dl compact="compact">
<dt><code>mtn add [--[no-]recursive] [--[no-]respect-ignore] <var>pathname...</var></code>
<a name="index-mtn-add-_005b_002d_002d_005bno_002d_005drecursive_005d-_005b_002d_002d_005bno_002d_005drespect_002dignore_005d-pathname_002e_002e_002e"></a>
</dt>
<dt><code>mtn add [--[no-]recursive] [--[no-]respect-ignore] --[no-]unknown [<var>pathname...</var>]</code>
<a name="index-mtn-add-_005b_002d_002d_005bno_002d_005drecursive_005d-_005b_002d_002d_005bno_002d_005drespect_002dignore_005d-_002d_002d_005bno_002d_005dunknown-_005bpathname_002e_002e_002e_005d"></a>
</dt>
<dd><p>This command places <code>add</code> entries for the paths specified in
<var>pathname...</var> in <a href="Storage-and-workflow.html#g_t_005fMTN_002frevision">_MTN/revision</a>; they will be part of the
next <code>commit</code>. See <a href="Storage-and-workflow.html#Storage-and-workflow">Storage and workflow</a> for
more information on <code>add</code> and <code>commit</code>.
</p>
<p>As a convenience, the <samp>--unknown <var>pathname...</var></samp> option can be used;
this option will cause all of the files listed by <code>mtn list
unknown <var>pathname...</var></code> to be added. However, note that the default
for <code>list unknown</code> is <samp>--recursive</samp>, while the default
for <code>add</code> is <samp>--no-recursive</samp>.
</p>
<p>Adding directories, whether explicitly or using the <samp>--unknown</samp>
option, is non-recursive by default. The <code>add</code> command can be
made recursive using the <samp>--recursive</samp> option.
</p>
<a name="mtn-attr"></a></dd>
<dt><code>mtn attr</code>
<a name="index-mtn-attr"></a>
</dt>
<dd><p>Manage <a href="File-Attributes.html#File-Attributes">File Attributes</a>.
</p>
<p>In <code>drop</code> and <code>get</code>, if no attribute is specified, the
command applies to all attributes attached to the file given in
<var>path</var>. Otherwise it applies only to the attribute specified in
<var>attr</var>.
</p>
<dl compact="compact">
<dd><a name="mtn-attr-drop"></a></dd>
<dt><code>mtn attr drop <var>path</var> [<var>attr</var>]</code></dt>
<dd><p>Remove attributes.
</p>
</dd>
<dt><code>mtn attr get <var>path</var> [<var>attr</var>]</code></dt>
<dd><p>Output the attributes.
</p>
</dd>
<dt><code>mtn attr set <var>path</var> <var>attr</var> <var>value</var></code></dt>
<dd><p>Sets <var>attr</var> on <var>path</var> to <var>value</var>.
</p>
</dd>
</dl>
<p>Several attributes are reserved for mtn use; they all start with “mtn:”:
</p><dl compact="compact">
<dt><code>mtn:encoding</code></dt>
<dd><p>Specify character encoding for the file.
</p>
</dd>
<dt><code>mtn:execute</code></dt>
<dd><p>File is executable.
</p>
</dd>
<dt><code>mtn:manual_merge</code></dt>
<dd><p>Don’t use internal or external diff or merger.
</p>
</dd>
<dt><code>mtn:resolve_conflict</code></dt>
<dd><p>Specify <code>drop</code> resolution for a recurring dropped/modified
conflict (<a href="Merge-Conflicts.html#dropped_005fmodified_005fconflict">dropped_modified_conflict</a>).
</p>
</dd>
</dl>
<a name="mtn-commit"></a></dd>
<dt><code>mtn commit</code>
<a name="index-mtn-commit"></a>
</dt>
<dt><code>mtn commit --message=<var>logmsg</var> [--message=<var>logmsg</var>...] [<var>pathname...</var>]</code>
<a name="index-mtn-commit-_002d_002dmessage_003dlogmsg-_005b_002d_002dmessage_003dlogmsg_002e_002e_002e_005d-_005bpathname_002e_002e_002e_005d"></a>
</dt>
<dt><code>mtn commit --message-file=<var>logfile</var> [<var>pathname...</var>]</code>
<a name="index-mtn-commit-_002d_002dmessage_002dfile_003dlogfile-_005bpathname_002e_002e_002e_005d"></a>
</dt>
<dt><code>mtn ci</code>
<a name="index-mtn-ci"></a>
</dt>
<dd><p><code>ci</code> is an alias for <code>commit</code>. See the online help for
more options.
</p>
<p>This command looks at your workspace, decides which files have
changed, and saves the changes to your database. It works by loading
the revision named in <a href="Storage-and-workflow.html#g_t_005fMTN_002frevision">_MTN/revision</a>, locating the base manifest
for your workspace, applying any pathname changes described, and then
comparing the updated base manifest to the files it finds in your
workspace, to determine which files have been edited.
</p>
<p>For each edited file, a delta is copied into the database. Then the
newly constructed manifest is recorded (as a delta) and finally the
new revision. Once all these objects are recorded in your database,
<code>commit</code> updates <samp>_MTN/revision</samp> to indicate that the base
revision is now the newly created revision, and that there are no
pathname changes to apply.
</p>
<p>Specifying pathnames to <code>commit</code> restricts the set of changes
that are visible and results in only a partial commit of the workspace.
Changes to files not included in the specified set of pathnames will be
ignored and will remain in the workspace until they are included in a
future commit. With a partial commit, only the relevant entries in
<samp>_MTN/revision</samp> will be removed and other entries will remain for
future commits.
</p>
<p>From within a subdirectory of the workspace the <code>commit</code> command
will, by default, include <em>all changes</em> in the workspace.
Specifying only the pathname "." will restrict <code>commit</code> to files
changed within the current subdirectory of the workspace.
</p>
<p>The <samp>--message</samp> and <samp>--message-file</samp> options are
mutually exclusive. Both provide a <var>logmsg</var> describing the
commit. <samp>--message-file</samp> specifies the name of the file
containing the log message, while <samp>--message</samp> provides it
directly.
</p>
<p>Multiple <samp>--message</samp> options may be provided on the command line.
The log message will be formed by concatenating the <samp>--message</samp>
options provided, with each one starting at the beginning of a new line.
</p>
<p>If neither <samp>--message-file</samp> nor <samp>--message</samp> are given,
the commit message defaults to the contents of <samp>_MTN/log</samp>, after
processing by the Lua hook <a href="User-Defaults.html#edit_005fcomment">edit_comment</a>. <samp>_MTN/log</samp> can be
edited by the user during their daily work to record the changes made
to the workspace.
</p>
<p>The default definition of <code>edit_comment</code> invokes the user’s
editor (specified by the environment variables <code>VISUAL</code> and
<code>EDITOR</code>, or <code>editor, vi</code>, or <code>notepad</code> on Windows).
</p>
<p><code>commit</code> formats the input to <code>edit_comment</code> as follows:
</p>
<div class="smallexample">
<pre class="smallexample"><contents of _MTN/log>
*** REMOVE THIS LINE TO CANCEL THE COMMIT ***
-- Enter a description of this change above --
-- Edit fields below to modify certificate values --
Branch: <from _MTN/options or option>
Author: <from key or option>
Date: <from system clock>
-- Modifications below this line are ignored --
Changes against parent <from _MTN/revision>
<list of changes>
</pre></div>
<p>When the user quits the editor, the text is processed as follows:
</p>
<ul>
<li> The final <var>logmsg</var> is all text up to the line “*** REMOVE THIS LINE
...” (the <em>cancel</em> line).
</li><li> If the <var>logmsg</var> is empty, the commit is aborted.
</li><li> If the cancel line is deleted or modified, the edited <var>logmsg</var> is
saved in <samp>_MTN/log</samp>, and the commit is aborted.
</li><li> The next two lines (instructions) are confirmed to be present. If not,
the commit is aborted, and the entire file is saved in <samp>_MTN/commit</samp>,
so the user may recover.
</li><li> The <em>Branch</em>, <em>Author</em>, and <em>Date</em> fields are parsed, and
the new values used for the commit. If the parsing fails, the commit
is aborted, and the entire file is saved in <samp>_MTN/commit</samp>,
so the user may recover.
<p>The date is formatted with the spec provided by <samp>--date-format</samp>
or Lua hook <code><a href="User-Defaults.html#get_005fdate_005fformat_005fspec">get_date_format_spec</a></code>. When the date field is
parsed, the same spec is used. Therefore this spec must be supported
by the operating system function for parsing dates; if not, the
monotone internal format of “yyyy-mm-ddThh:mm:ss” is used for both
formatting and parsing.
</p>
</li><li> The rest of the text is ignored.
</li></ul>
<p>If the commit is successful, the <samp>_MTN/log</samp> file is cleared of
all content making it ready for another edit/commit cycle.
</p>
<p>As a special case, if <samp>--message-file=_MTN/log</samp> is specified,
the contents of <samp>_MTN/log</samp> will be used without first invoking
<code>edit_comment</code>.
</p>
<p>If a <samp>--branch</samp> option is specified, the <code>commit</code> command
commits to this branch (creating it if necessary). The branch becomes
the new default branch of the workspace.
</p>
<p>The <code>commit</code> command also synthesizes a number of
certificates, which it attaches to the new manifest version and copies
into your database:
</p><ul>
<li> An <code>author</code> cert, indicating the person responsible for the
changes leading to the new revision. Normally this defaults to your
signing key or the return value of the <a href="User-Defaults.html#get_005fauthor">get_author</a> hook; you may
override this by passing the <samp>--author</samp> option to commit, or by
editing the <em>Author</em> field in your editor. This is useful when
committing a patch on behalf of someone else, or when importing “by
hand” from another version control system.
</li><li> A <code>branch</code> cert, indicating the branch the committed revision
belongs to.
</li><li> A <code>date</code> cert, indicating when the new revision was created.
Normally this defaults to the current date and time; you may override
this by passing the <samp>--date</samp> option to commit, or by editing
the <em>Date</em> field in your editor. This is useful when importing
“by hand” from another version control system.
</li><li> A <code>changelog</code> cert, containing the <var>logmsg</var>.
</li></ul>
</dd>
<dt><code>mtn drop [--[no]-recursive] [--bookkeep-only] <var>pathname...</var></code>
<a name="index-mtn-drop-_005b_002d_002d_005bno_005d_002drecursive_005d-_005b_002d_002dbookkeep_002donly_005d-pathname_002e_002e_002e"></a>
</dt>
<dt><code>mtn drop --missing <var>pathname...</var></code>
<a name="index-mtn-drop-_002d_002dmissing-pathname_002e_002e_002e"></a>
</dt>
<dt><code>mtn rm</code>
<a name="index-mtn-rm"></a>
</dt>
<dd><p><code>rm</code> is an alias for <code>drop</code>.
</p>
<p>This command places “drop” entries for the paths specified in
<var>pathname...</var> in <a href="Storage-and-workflow.html#g_t_005fMTN_002frevision">_MTN/revision</a> and deletes the file from the
workspace. This will be part of the next <code>commit</code>. If any of
<var>pathname...</var> is a directory, and <samp>--recursive</samp> is not
given, and the directory contains any versioned files, the command
will fail. If <samp>--recursive</samp> is given, the versioned files will be
dropped. If the directory contains unversioned files, it will be
dropped from the revision, but not deleted from the disk.
</p>
<p>If <samp>--missing</samp> is given, <code>drop</code> will add drop entries
for any versioned paths in <var>pathname...</var> for which you have
already removed the files from the filesystem.
</p>
<p>This command also removes any attributes on <var>pathname</var>; see
<a href="File-Attributes.html#File-Attributes">File Attributes</a> for more details.
</p>
<p>If <samp>--bookkeep-only</samp> is given, or if a file is different from
the version in the base revision, <code>drop</code> will drop remove
<var>pathname...</var> from the revision at commit time, but <em>not</em>
remove the file from the workspace.
</p>
<p>See the <code>undrop</code> command for undoing a <code>drop</code> before commit.
</p>
</dd>
<dt><code>mtn mkdir [--[no-]respect-ignore] <var>directory...</var></code>
<a name="index-mtn-mkdir-_005b_002d_002d_005bno_002d_005drespect_002dignore_005d-directory_002e_002e_002e"></a>
</dt>
<dd><p>This command creates directories in the filesystem relative to your
current location and adds them to <a href="Storage-and-workflow.html#g_t_005fMTN_002frevision">_MTN/revision</a>. This will be
part of the next <code>commit</code>.
</p>
<p>Normally, if any of <var>directory...</var> are in <samp>.mtn-ignore</samp>, this
command will fail. You can use <samp>--no-respect-ignore</samp> to
override this check. But it would be better to remove <var>directory</var>
from <samp>.mtn-ignore</samp>.
</p>
</dd>
<dt><code>mtn pivot_root [--bookkeep-only] [--[no-]move-conflicting-paths] <var>new_root</var> <var>put_old</var></code>
<a name="index-mtn-pivot_005froot-_005b_002d_002dbookkeep_002donly_005d-_005b_002d_002d_005bno_002d_005dmove_002dconflicting_002dpaths_005d-new_005froot-put_005fold"></a>
</dt>
<dd><p>Most users will never need this command. It is primarily useful in
certain tricky cases where one wishes to combine several projects
into one, or split one project into several. See also <code>merge_into_dir</code>.
</p>
<p>Its effect is to rename the directory whose name is currently
<var>new_root</var> to become the root directory of the versioned tree, and
to at the same time rename the directory that is currently the root of
the versioned tree to have the name <var>put_old</var>. Conceptually, it
is equivalent to executing the following commands in the root of the
workspace:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn rename . <var>new_root</var>/<var>put_old</var>
$ mtn rename <var>new_root</var> .
</pre></div>
<p>Except, of course, that these <code>rename</code> commands are illegal,
because after the first command the tree has no root at all, and there
is a directory loop. This illegality is the only reason for
<code>pivot_root</code>’s existence; internally, the result is treated
exactly like two renames, including with respect to merges and
updates.
</p>
<p>The use of <samp>--bookkeep-only</samp> with this command is not
recommended. It causes the changes to be made in monotone’s
records, but not in the filesystem itself.
</p>
<p>When running <code>pivot_root</code>, it is sometimes possible for
<a href="Workspace-Collisions.html#Workspace-Collisions">Workspace Collisions</a> to occur.
</p>
<a name="mtn-pluck"></a></dd>
<dt><code>mtn pluck [--[no-]move-conflicting-paths] --revision=<var>to</var></code>
<a name="index-mtn-pluck-_005b_002d_002d_005bno_002d_005dmove_002dconflicting_002dpaths_005d-_002d_002drevision_003dto"></a>
</dt>
<dt><code>mtn pluck [--[no-]move-conflicting-paths] --revision=<var>from</var> --revision=<var>to</var></code>
<a name="index-mtn-pluck-_005b_002d_002d_005bno_002d_005dmove_002dconflicting_002dpaths_005d-_002d_002drevision_003dfrom-_002d_002drevision_003dto"></a>
</dt>
<dd><p>See the online help for more options. See <a href="Selectors.html#Selectors">Selectors</a>.
</p>
<p>This command takes changes made at any point in history, and attempts to
edit your current workspace to include those changes. The end result is
identical to running <code>mtn diff <samp>-r</samp> <var>from</var>
<samp>-r</samp> <var>to</var> | patch <samp>-p0</samp></code>, except that this command
uses monotone’s merger, and thus intelligently handles renames,
conflicts, and so on.
</p>
<p>If only one revision is given, applies the changes made in <var>to</var> as
compared with <var>to</var>’s parent. If two revisions are given, applies
the changes made to get from <var>from</var> to <var>to</var>.
</p>
<p>Note that this is not a true cherrypick operation. A true cherrypick,
as that word is used in version control theory, involves applying some
changes out of context, and then recording the identity between the
original changes and the newly applied changes for the use of later
merges. This command does the first part, not the second. As far as
monotone is concerned, the changes made by <code>mtn pluck</code> are
exactly like those made in an editor; the command is simply a
convenient way to make certain edits quickly. In practice, this is
rarely a problem. <code>mtn pluck</code> should almost always be used
between branches that will never be merged — for instance,
backporting fixes from a development branch to a stable branch.
</p>
<p>When you use <code>pluck</code> you are going behind monotone’s back, and
reducing its ability to help you keep track of what has happened in
your history. Never use <code>pluck</code> where a true merging command
like <code>merge</code>, <code>propagate</code>, or <code>explicit_merge</code>
will do. If you find yourself using <code>pluck</code> often, you should
consider carefully whether there is any way to change your workflow to
reduce your need for <code>pluck</code>ing.
</p>
<p><a href="Merge-Conflicts.html#Merge-Conflicts">Merge Conflicts</a> and <a href="Workspace-Collisions.html#Workspace-Collisions">Workspace Collisions</a> can occur.
</p>
</dd>
<dt><code>mtn rename [--bookkeep-only] <var>src</var> <var>dst</var></code>
<a name="index-mtn-rename-_005b_002d_002dbookkeep_002donly_005d-src-dst"></a>
</dt>
<dt><code>mtn rename [--bookkeep-only] <var>src</var> <var>...</var> <var>dst/</var></code>
<a name="index-mtn-rename-_005b_002d_002dbookkeep_002donly_005d-src-_002e_002e_002e-dst_002f"></a>
</dt>
<dt><code>mtn mv</code>
<a name="index-mtn-mv"></a>
</dt>
<dd><p><code>mv</code> is an alias for <code>rename</code>.
</p>
<p>This command places <code>rename</code> entries for the paths specified in
<var>src</var> and <var>dst</var> in <a href="Storage-and-workflow.html#g_t_005fMTN_002frevision">_MTN/revision</a>, and (if
<samp>--bookkeep-only</samp> is not specified) renames the paths on the
disk. This will be part of the next <code>commit</code>.
</p>
<p>The second form renames a number of source paths (or a single source,
if <var>dst</var> ends in ’/’) to the given destination. In this case
<var>dst</var> will be created if necessary, and added to the workspace if
it is not already versioned.
</p>
<p>This command also moves any attributes on <var>src</var> to <var>dst</var>; see
<a href="File-Attributes.html#File-Attributes">File Attributes</a> for more details.
</p>
<p>Note that you cannot rename a branch. You can accomplish something
similar by creating a new branch with the desired name, using the
<a href="Review.html#mtn-approve">mtn approve</a> command to add a branch name to the desired revision.
</p>
<a name="mtn-revert"></a></dd>
<dt><code>mtn revert <var>pathname...</var></code>
<a name="index-mtn-revert-pathname_002e_002e_002e"></a>
</dt>
<dt><code>mtn revert --missing <var>pathname...</var></code>
<a name="index-mtn-revert-_002d_002dmissing-pathname_002e_002e_002e"></a>
</dt>
<dd><p>See the online help for more options.
</p>
<p>This command changes your workspace, so that changes you have made
since the last checkout or update are discarded. The command is
restricted the set of files or directories given as arguments. To
revert the entire workspace, use <code>revert</code> "." in the
top-level directory. Specifying "." in a subdirectory will restrict
<code>revert</code> to files changed within the current subdirectory.
</p>
<p>If <samp>--missing</samp> is given it reverts any versioned files in
<var>pathname...</var> that have been deleted from the workspace.
</p>
<a name="mtn-undrop"></a></dd>
<dt><code>mtn undrop <var>pathname...</var></code>
<a name="index-mtn-undrop-pathname_002e_002e_002e"></a>
</dt>
<dd><p>Undoes a previous <code>drop</code>; useful when you make a mistake. If
the file was deleted from the workspace, this reverts it. If it was
not deleted (because it was changed or <samp>--bookkeep-only</samp> was
given), it just removes the pending drop.
</p>
<a name="mtn-update"></a></dd>
<dt><code>mtn update [--[no-]move-conflicting-paths] [--branch <var>branchname</var>]</code>
<a name="index-mtn-update-_005b_002d_002d_005bno_002d_005dmove_002dconflicting_002dpaths_005d-_005b_002d_002dbranch-branchname_005d"></a>
</dt>
<dt><code>mtn update [--[no-]move-conflicting-paths] --revision=<var>revision</var></code>
<a name="index-mtn-update-_005b_002d_002d_005bno_002d_005dmove_002dconflicting_002dpaths_005d-_002d_002drevision_003drevision"></a>
</dt>
<dd><p>This command changes your workspace to have the a different revision as
the base revision. See <a href="Selectors.html#Selectors">Selectors</a>.
</p>
<p><code>update</code> performs 3 separate stages. If any of these stages
fails, the update aborts, doing nothing. The first two stages select
the target revision; they are skipped if <samp>--revision</samp> is given
- that revision is the target.
</p>
<p>In the first stage, if <samp>--branch</samp> is not given, the workspace
branch is used. If <samp>--branch</samp> is given, the branch becomes the
new default branch of the workspace (even if you also specify an
explicit <samp>--revision</samp> argument).
</p>
<ul>
<li> Examine the ancestry graph of revisions on the branch in your
database, and (subject to trust evaluation; see <a href="Trust-Evaluation-Hooks.html#Trust-Evaluation-Hooks">Trust Evaluation Hooks</a>) select the set of all descendants of your workspace’s base
revision. Call this set the “candidates” of the update.
</li><li> Remove any candidates which lack acceptable testresult certificates;
see <a href="Trust-Evaluation-Hooks.html#accept_005ftestresult_005fchange">accept_testresult_change</a> (defaults to all candidates). From
the remaining candidates, select the deepest child by ancestry and
call it the “target” of the update.
</li><li> Merge the target of the update with the workspace, in memory, and
if the merge is successful, write the result over top of the workspace.
</li></ul>
<p>The effect is always to take whatever changes you have made in the
workspace, and to “transpose” them onto a new revision, using
monotone’s 3-way merge algorithm to achieve good results. Note that
with the explicit <samp>--revision</samp> argument, it is possible to update
“backwards” or “sideways” in history — for example, reverting to
an earlier revision, or if your branch has two heads, updating to the
other. In all cases, the end result will be whatever revision you
specified, with your local changes (and only your local changes)
applied.
</p>
<p><a href="Merge-Conflicts.html#Merge-Conflicts">Merge Conflicts</a> and <a href="Workspace-Collisions.html#Workspace-Collisions">Workspace Collisions</a> can occur.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Network.html#Network" accesskey="n" rel="next">Network</a>, Previous: <a href="Tree.html#Tree" accesskey="p" rel="prev">Tree</a>, Up: <a href="Command-Reference.html#Command-Reference" accesskey="u" rel="up">Command Reference</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|