/usr/share/doc/monotone/html/Network.html is in monotone-doc 1.0-12.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: Network</title>
<meta name="description" content="monotone documentation: Network">
<meta name="keywords" content="monotone documentation: Network">
<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="Informative.html#Informative" rel="next" title="Informative">
<link href="Workspace.html#Workspace" rel="prev" title="Workspace">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
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" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Network"></a>
<div class="header">
<p>
Next: <a href="Informative.html#Informative" accesskey="n" rel="next">Informative</a>, Previous: <a href="Workspace.html#Workspace" accesskey="p" rel="prev">Workspace</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="Network-1"></a>
<h3 class="section">4.4 Network</h3>
<dl compact="compact">
<dt><code>mtn serve [--bind=[<var>address</var>][:<var>port</var>]]</code>
<a name="index-mtn-serve-_005b_002d_002dbind_003d_005baddress_005d_005b_003aport_005d_005d"></a>
</dt>
<dt><code>mtn pull [--[no-]set-default] [--[no-]dry-run] [<var>uri</var>]</code>
<a name="index-mtn-pull-_005b_002d_002d_005bno_002d_005dset_002ddefault_005d-_005b_002d_002d_005bno_002d_005ddry_002drun_005d-_005buri_005d"></a>
</dt>
<dt><code>mtn push [--[no-]set-default] [--[no-]dry-run] [--keys-to-push=<var>key</var>] [<var>uri</var>]</code>
<a name="index-mtn-push-_005b_002d_002d_005bno_002d_005dset_002ddefault_005d-_005b_002d_002d_005bno_002d_005ddry_002drun_005d-_005b_002d_002dkeys_002dto_002dpush_003dkey_005d-_005buri_005d"></a>
</dt>
<dt><code>mtn sync [--[no-]set-default] [--[no-]dry-run] [--keys-to-push=<var>key</var>] [<var>uri</var>]</code>
<a name="index-mtn-sync-_005b_002d_002d_005bno_002d_005dset_002ddefault_005d-_005b_002d_002d_005bno_002d_005ddry_002drun_005d-_005b_002d_002dkeys_002dto_002dpush_003dkey_005d-_005buri_005d"></a>
</dt>
<dt><code>mtn pull [--[no-]set-default] [<var>address</var>] [<var>glob</var> [...] [--exclude=<var>exclude-glob</var>]]] <strong>deprecated</strong></code>
<a name="index-mtn-pull-_005b_002d_002d_005bno_002d_005dset_002ddefault_005d-_005baddress_005d-_005bglob-_005b_002e_002e_002e_005d-_005b_002d_002dexclude_003dexclude_002dglob_005d_005d_005d-deprecated"></a>
</dt>
<dt><code>mtn push [--[no-]set-default] [--keys-to-push=<var>key</var>] [<var>address</var>] [<var>glob</var> [...] [--exclude=<var>exclude-glob</var>]]] <strong>deprecated</strong></code>
<a name="index-mtn-push-_005b_002d_002d_005bno_002d_005dset_002ddefault_005d-_005b_002d_002dkeys_002dto_002dpush_003dkey_005d-_005baddress_005d-_005bglob-_005b_002e_002e_002e_005d-_005b_002d_002dexclude_003dexclude_002dglob_005d_005d_005d-deprecated"></a>
</dt>
<dt><code>mtn sync [--[no-]set-default] [--keys-to-push=<var>key</var>] [<var>address</var>] [<var>glob</var> [...] [--exclude=<var>exclude-glob</var>]]] <strong>deprecated</strong></code>
<a name="index-mtn-sync-_005b_002d_002d_005bno_002d_005dset_002ddefault_005d-_005b_002d_002dkeys_002dto_002dpush_003dkey_005d-_005baddress_005d-_005bglob-_005b_002e_002e_002e_005d-_005b_002d_002dexclude_003dexclude_002dglob_005d_005d_005d-deprecated"></a>
</dt>
<dd><p>See the online help for more options. See <a href="Common-Options.html#g_t_002d_002dupdate">--update</a>.
</p>
<p>These commands operate the “netsync” protocol built into
monotone. This is a custom protocol for rapidly synchronizing two
monotone databases using a hash tree index. The protocol is “peer to
peer”, but requires one peer to listen for incoming connections (the
server) and the other peer (the client) to connect to the server. When
run with <samp>--stdio</samp>, the server listens for a single connection
then terminates. When run with <samp>--bind</samp>, or with neither
option, the server listens for TCP connections and serves them
continuously, until it is shut down.
</p>
<p>The network <var>address</var> given to <code>serve</code> as an argument to
<samp>--bind</samp> should be a host name to listen on, optionally
followed by a colon and a port number. The default port number is
4691. If no <samp>--bind</samp> option is given, the server listens on
port 4691 of every network interface.
</p>
<p>If <code>serve</code> is run with <samp>--stdio</samp>, a single netsync
session is served over the <code>stdin</code> and <code>stdout</code> file
descriptors. If <samp>--no-transport-auth</samp> is provided along with
<samp>--stdio</samp>, transport authentication and access control mechanisms
are disabled. Only use <samp>--no-transport-auth</samp> if you are certain
that the transport channel in use already provides sufficient
authentication and authorization facilities.
</p>
<p>If <samp>--dry-run</samp> is given, the connection is made, but no data is
transferred. Instead, a summary of what would be transferred is
output; the number of revisions, certs and keys that would be sent and
received. For sent revisions, the branch names are also output.
</p>
<p>The <var>uri-or-address</var> arguments given to <code>push</code>,
<code>pull</code>, and <code>sync</code> can be of two possible forms.
</p>
<p>If the argument is an URI, the Lua hook
<a href="Netsync-Transport-Hooks.html#get_005fnetsync_005fconnect_005fcommand">get_netsync_connect_command</a> may transform it into a connection
command, which is later executed as the transport channel for netsync.
The URI itself consists of a connection scheme, an optional user (only
used for <code>ssh</code>-related transports), a host with an optional port
(which both might be optional as well, f.e. for the <code>file</code>
scheme), a path and a query part, which denotes one or more branches
and optionally also exclude patterns for the exchange:
</p>
<a name="netsync-uri"></a><div class="smallexample">
<pre class="smallexample"><scheme>://[[<user>@]<host>[:<port>]][/<path>][?<pattern>[;-<exclude-pattern>[...]]]
</pre></div>
<p>Valid examples of URIs monotone accepts are:
</p>
<div class="smallexample">
<pre class="smallexample">mtn://my.server:4690?my.branch
mtn://my.server/project?my.other.branch*;-my.other.branch.test
file:///path/to/database.mtn?my.branch
ssh://joe@my.server/~/db.mtn?joes.branch
</pre></div>
<p><code>file:</code> and <code>ssh:</code> are not supported on Windows native, but
they are supported on Windows Cygwin.
</p>
<p>If the server has a multi-host setup, the path component of the URI
might be used to distinguish between different databases (please ask the
provider of the server for details).
</p>
<p>For backward compatibility, if the argument is a simple hostname (with
no scheme, but with optional port number), monotone will default to
the <code>mtn:</code> URI scheme, i.e. use a TCP socket to the specified
host and port. The <var>glob</var> parameters then indicate a set of
branches to exchange. Multiple <var>glob</var> and <samp>--exclude</samp>
options can be specified. <strong>Important notice:</strong> This call syntax
is deprecated and subject to removal in future versions of monotone!
</p>
<p>For both syntaxes, every branch which matches a <var>glob</var> or branch pattern
exactly, and does not match an <var>exclude-glob</var> or exclude pattern, will be
indexed and made available for synchronization.
</p>
<p>For example, perhaps Bob and Alice wish to synchronize their
<code>net.venge.monotone.win32</code> and <code>net.venge.monotone.i18n</code>
branches. Supposing Alice’s computer has hostname
<code>alice.someisp.com</code>, then Alice might run:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn --bind=alice.someisp.com serve
</pre></div>
<p>And Bob might run
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn sync "mtn://alice.someisp.com?net.venge.monotone*"
</pre></div>
<p>When the operation completes, all branches matching
<code>net.venge.monotone*</code> will be synchronized between Alice and Bob’s
databases.
</p>
<p>The <code>pull</code>, <code>push</code>, and <code>sync</code> commands only
require you pass <var>uri</var> the first time you use one of them;
monotone will store this in the database and in the future default to
the same URI. For instance, if Bob wants to <code>sync</code> with Alice
again, he can simply run:
</p>
<div class="smallexample">
<pre class="smallexample">$ mtn sync
</pre></div>
<p>Of course, he can still <code>sync</code> with other people and other
branches by passing an URI, address or address plus globs on the command
line; this will not affect his default affinity for Alice. If you ever
do want to change your defaults, simply pass the <samp>--set-default</samp>
option when connecting to the server and branch pattern that you want to
make the new default.
</p>
<p>The <code>serve</code> command doesn’t care about workspaces, so even if
you stand in one, you will have to give it the database to serve, the
server key to use and the key directory explicitly.
</p>
<p>In the server, different permissions can be applied to each branch;
see <a href="Netsync-Permission-Hooks.html#get_005fnetsync_005fread_005fpermitted">get_netsync_read_permitted</a> and
<a href="Netsync-Permission-Hooks.html#get_005fnetsync_005fwrite_005fpermitted">get_netsync_write_permitted</a>.
</p>
<p>If <samp>--pid-file</samp> is specified, <code>serve</code> will create the
specified file and record the process identifier of the server in the
file. This file can then be read to identify specific monotone server
processes.
</p>
<p>The syntax for patterns is very simple. <code>*</code> matches 0 or more
arbitrary characters. <code>?</code> matches exactly 1 arbitrary character
(you need to escape that with <code>%3F</code> in a URI). <code>{,}</code>
matches alternatives; <code>{foo,bar,baz}</code> matches “foo”, or
“bar”, or “baz”. These can be combined arbitrarily. A backslash
(<code>\</code>) escapes these special characters, to match exactly that
character; this might be useful in case someone, for some odd
reason, decides to put a “*” into their branch name.
</p>
<a name="mtn-clone"></a></dd>
<dt><code>mtn clone <var>uri</var> [--branch=<var>branchname</var>] [--revision=<var>rev</var>] [<var>directory</var>]</code>
<a name="index-mtn-clone-uri-_005b_002d_002dbranch_003dbranchname_005d-_005b_002d_002drevision_003drev_005d-_005bdirectory_005d"></a>
</dt>
<dt><code>mtn clone <var>address</var>[:<var>port</var>] <var>branchname</var> [<var>directory</var>] <strong>deprecated</strong></code>
<a name="index-mtn-clone-address_005b_003aport_005d-branchname-_005bdirectory_005d-deprecated"></a>
</dt>
<dd><p><code>clone</code> is a helper command that performs the roles of a
number of other commands all at once. First, it constructs a new
database. If no database is given, the configured default database is
created or re-used (see <a href="User-Defaults.html#get_005fdefault_005fdatabase_005falias">get_default_database_alias</a> for more
details; <samp>~/.monotone/default.mtn</samp> by default). Then it populates
this database by <code>pull</code>ing any data which match the branch
pattern in the <var>uri</var> argument from the remote database.
</p>
<p>The branch pattern must specify a single branch; <code>clone</code> uses
that to determine which branch to checkout.
</p>
<p>Finally, <code>clone</code> copies the files out of the newly created
database into a local directory, just as <code>checkout</code> would. If
no <var>directory</var> is given, the <var>branchname</var> is used as
directory. If <samp>--revision</samp> is given, that revision must be on
the specified branch, and is checked out; otherwise the head of the
branch is checked out.
</p>
<p><strong>Important notice:</strong> The <var>address</var>[:<var>port</var>] <var>branchname</var>
call syntax is deprecated and subject to removal in future versions of monotone!
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Informative.html#Informative" accesskey="n" rel="next">Informative</a>, Previous: <a href="Workspace.html#Workspace" accesskey="p" rel="prev">Workspace</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>
|