/usr/share/doc/monotone/html/Making-Changes.html is in monotone-doc 1.0-3.
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 | <html lang="en">
<head>
<title>Making Changes - monotone documentation</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="monotone documentation">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Tutorial.html#Tutorial" title="Tutorial">
<link rel="prev" href="Synchronising-Databases.html#Synchronising-Databases" title="Synchronising Databases">
<link rel="next" href="Dealing-with-a-Fork.html#Dealing-with-a-Fork" title="Dealing with a Fork">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="texinfo.css">
</head>
<body>
<div class="node">
<a name="Making-Changes"></a>
<p>
Next: <a rel="next" accesskey="n" href="Dealing-with-a-Fork.html#Dealing-with-a-Fork">Dealing with a Fork</a>,
Previous: <a rel="previous" accesskey="p" href="Synchronising-Databases.html#Synchronising-Databases">Synchronising Databases</a>,
Up: <a rel="up" accesskey="u" href="Tutorial.html#Tutorial">Tutorial</a>
<hr>
</div>
<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:
<pre class="smallexample">$ mtn --db=abe.mtn --branch=jp.co.juicebot.jb7 checkout .
</pre>
<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><span class="file">.</span></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><span class="file">src/apple.c</span></samp>, and edits it:
<pre class="smallexample">$ vi src/apple.c
<i><Abe writes some apple-juice dispensing code></i>
</pre>
<p>The file <samp><span class="file">src/apple.c</span></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:
<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>
<p>Satisfied with his day's work, Abe decides to commit.
<pre class="smallexample">$ mtn commit
</pre>
<p>Abe neglected to provide a <samp><span class="option">--message</span></samp> option specifying the
change log on the command line. Monotone therefore invokes an
external “log message editor” — typically an editor like
<samp><span class="command">vi</span></samp> — with an explanation of the changes being committed
and the opportunity to enter a log message.
<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>
<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:
<pre class="smallexample">mtn: beginning commit on branch 'jp.co.juicebot.jb7'
mtn: committed revision 42eae36587508faa664b111cefc291f0b85ef83a
</pre>
<p>Abe then sends his new revision back to Jim:
<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>
<p>Beth does a similar sequence. First she syncs her database with
Jim's:
<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>
<p>She checks out a copy of the tree from her database:
<pre class="smallexample">$ mtn --db=:beth --branch=jp.co.juicebot.jb7 checkout juicebot
</pre>
<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 <samp><span class="command">mtn list databases</span></samp> and sees the
following:
<pre class="smallexample">$ mtn list databases
:beth.mtn (in /home/beth/.monotone/databases):
jp.co.juicebot.jb7 (in /home/beth/juicebot)
</pre>
<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>But let us get back to the work, Beth now start to edits the file
<samp><span class="file">src/banana.c</span></samp>:
<pre class="smallexample">$ vi src/banana.c
<i><Beth writes some banana-juice dispensing code></i>
</pre>
<p>and logs her changes in <samp><span class="file">_MTN/log</span></samp> right away so she does not
forget what she has done like Abe.
<pre class="smallexample">$ vi _MTN/log
* src/banana.c: Added polling implementation
</pre>
<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:
<pre class="smallexample">$ mtn commit
mtn: beginning commit on branch 'jp.co.juicebot.jb7'
mtn: committed revision 85573a54105cd3220db10aa6a0713643cdf5ce6f
</pre>
<p>And she syncs with Jim again:
<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>
</body></html>
|