/usr/share/doc/monotone/html/Making-Changes.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 | <!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: Making Changes</title>
<meta name="description" content="monotone documentation: Making Changes">
<meta name="keywords" content="monotone documentation: Making Changes">
<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="Tutorial.html#Tutorial" rel="up" title="Tutorial">
<link href="Dealing-with-a-Fork.html#Dealing-with-a-Fork" rel="next" title="Dealing with a Fork">
<link href="Synchronising-Databases.html#Synchronising-Databases" rel="prev" title="Synchronising Databases">
<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="Making-Changes"></a>
<div class="header">
<p>
Next: <a href="Dealing-with-a-Fork.html#Dealing-with-a-Fork" accesskey="n" rel="next">Dealing with a Fork</a>, Previous: <a href="Synchronising-Databases.html#Synchronising-Databases" accesskey="p" rel="prev">Synchronising Databases</a>, Up: <a href="Tutorial.html#Tutorial" accesskey="u" rel="up">Tutorial</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="Making-Changes-1"></a>
<h3 class="section">2.10 Making Changes</h3>
<p>Abe decides to do some work on his part of the code. He has a copy of
Jim’s database contents, but cannot edit any of that data yet. He
begins his editing by checking out the head of the
<code>jp.co.juicebot.jb7</code> branch into a workspace, so he can edit
it:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn --db=abe.mtn --branch=jp.co.juicebot.jb7 checkout .
</pre></div>
<p>Monotone unpacks the set of files in the head revision’s manifest
directly into Abe’s current directory. (If he had specified something
other than <samp>.</samp> at the end, monotone would have created that
directory and unpacked the files into it.) Abe then opens up one of the
files, <samp>src/apple.c</samp>, and edits it:
</p>
<div class="smallexample">
<pre class="smallexample">$ vi src/apple.c
<i><Abe writes some apple-juice dispensing code></i>
</pre></div>
<p>The file <samp>src/apple.c</samp> has now been <em>changed</em>. Abe gets
up to answer a phone call, and when he returns to his work he has
forgotten what he changed. He can ask monotone for details:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn diff
#
# old_revision [493bda86628fd72c992eb56f73899db9ead3cf6f]
#
# patch "src/apple.c"
# from [1ce885d2cc59842ff16785834391e864068fbc3c]
# to [e2c64f6bde75a192d48d2256385df3dd7a963349]
#
============================================================
--- src/apple.c 1ce885d2cc59842ff16785834391e864068fbc3c
+++ src/apple.c e2c64f6bde75a192d48d2256385df3dd7a963349
@ -3,5 +3,8 @ dispense_apple_juice()
void
dispense_apple_juice()
{
- /* Fill this in please, Abe. */
+ spoutctl(APPLE_SPOUT, FLOW_JUICE, 1);
+ while (spoutctl(APPLE_SPOUT, POLL_JUICE, 1) == 0)
+ usleep (1000);
+ spoutctl(APPLE_SPOUT, FLOW_JUICE, 0);
}
</pre></div>
<p>Satisfied with his day’s work, Abe decides to commit.
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn commit
</pre></div>
<p>Abe neglected to provide a <samp>--message</samp> option specifying the
change log on the command line. Monotone therefore invokes an
external “log message editor” — typically an editor like
<code>vi</code> — with an explanation of the changes being committed
and the opportunity to enter a log message.
</p>
<div class="smallexample">
<pre class="smallexample">
*** REMOVE THIS LINE TO CANCEL THE COMMIT ***
-- Enter a description of this change above --
-- Edit fields below to modify certificate values --
Branch: right
Author: tester@test.net
Date: 2010-09-11T12:03:15
-- Modifications below this line are ignored --
Changes against parent 493bda86628fd72c992eb56f73899db9ead3cf6f
patched src/apple.c
</pre></div>
<p>Abe enters a single line at the top of the file, saying “polling
implementation of src/apple.c”. He then saves the file and quits the
editor. Monotone extracts the message to be stored in the associated
“changelog” cert. Returning to the shell, Abe’s commit completes:
</p>
<div class="smallexample">
<pre class="smallexample">mtn: beginning commit on branch 'jp.co.juicebot.jb7'
mtn: committed revision 42eae36587508faa664b111cefc291f0b85ef83a
</pre></div>
<p>Abe then sends his new revision back to Jim:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn sync
mtn: connecting to mtn://jim-laptop.juicebot.co.jp
mtn: finding items to synchronize:
mtn: certs | keys | revisions
mtn: 8 | 2 | 2
mtn: bytes in | bytes out | revs in | revs out | revs written
mtn: 615 | 2822 | 0 | 1 | 0
mtn: successful exchange with mtn://jim-laptop.juicebot.co.jp
</pre></div>
<p>Beth does a similar sequence. First she syncs her database with
Jim’s:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn --db=:beth sync "mtn://jim-laptop.juicebot.co.jp?jp.co.juicebot.jb7*"
mtn: connecting to mtn://jim-laptop.juicebot.co.jp
mtn: first time connecting to server mtn://jim-laptop.juicebot.co.jp
mtn: I'll assume it's really them, but you might want to double-check
mtn: their key's fingerprint: 9e9e9ef1d515ad58bfaa5cf282b4a872d8fda00c
mtn: warning: saving public key for jim@juicebot.co.jp to database
mtn: finding items to synchronize:
mtn: bytes in | bytes out | revs in | revs out | revs written
mtn: 4601 | 1239 | 2 | 0 | 1
mtn: verifying new revisions (this may take a while)
mtn: bytes in | bytes out | revs in | revs out | revs written
mtn: 4601 | 1285 | 2 | 0 | 2
mtn: successful exchange with mtn://jim-laptop.juicebot.co.jp
</pre></div>
<p>She checks out a copy of the tree from her database:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn --db=:beth --branch=jp.co.juicebot.jb7 checkout juicebot
</pre></div>
<p>and since she is using a managed database, monotone automatically remembers
the connection between the newly created workspace and the database. She
now looks at the output of <code>mtn list databases</code> and sees the
following:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn list databases
:beth.mtn (in /home/beth/.monotone/databases):
jp.co.juicebot.jb7 (in /home/beth/juicebot)
</pre></div>
<p>Beth realizes that, whenever the database of the workspace changes, monotone
will adapt the known paths for the old and the new database for her.
</p>
<p>But let us get back to the work, Beth now start to edits the file
<samp>src/banana.c</samp>:
</p>
<div class="smallexample">
<pre class="smallexample">$ vi src/banana.c
<i><Beth writes some banana-juice dispensing code></i>
</pre></div>
<p>and logs her changes in <samp>_MTN/log</samp> right away so she does not
forget what she has done like Abe.
</p>
<div class="smallexample">
<pre class="smallexample">$ vi _MTN/log
* src/banana.c: Added polling implementation
</pre></div>
<p>Later, she commits her work. Monotone again invokes an external editor
for her to edit her log message, but this time it fills in the messages
she’s written so far, and she simply checks them over one last time
before finishing her commit:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn commit
mtn: beginning commit on branch 'jp.co.juicebot.jb7'
mtn: committed revision 85573a54105cd3220db10aa6a0713643cdf5ce6f
</pre></div>
<p>And she syncs with Jim again:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn sync
mtn: connecting to mtn://jim-laptop.juicebot.co.jp
mtn: finding items to synchronize:
mtn: certs | keys | revisions
mtn: 12 | 3 | 3
mtn: bytes in | bytes out | revs in | revs out | revs written
mtn: 709 | 2879 | 0 | 1 | 0
mtn: successful exchange with mtn://jim-laptop.juicebot.co.jp
</pre></div>
<hr>
<div class="header">
<p>
Next: <a href="Dealing-with-a-Fork.html#Dealing-with-a-Fork" accesskey="n" rel="next">Dealing with a Fork</a>, Previous: <a href="Synchronising-Databases.html#Synchronising-Databases" accesskey="p" rel="prev">Synchronising Databases</a>, Up: <a href="Tutorial.html#Tutorial" accesskey="u" rel="up">Tutorial</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>
|