expoweb/handbook/computing/qstart-hg.html

96 lines
5.1 KiB
HTML

<td>|</td>
<td><a href="years/2018/">2018</a></td>
<title>Handbook placeholder page</title>
<link rel="stylesheet" type="text/css" href="../../css/main2.css" />
</head>
<body>
<h2 id="tophead">CUCC Expedition Handbook - Mercurial Quick</h2>
<h1>Quick Reminder - Mercurial</h1>
<h2>Version Control Software Reminders</h2>
<p>This is NOT a tutorial. This is a set of reminders for people who already know all this stuff.
<p>Since 2019 all use of version control software requires that you
have <a href="keyexchange.html">cryptographic key exchange</a> already set up before any of this will work on your own machine.
<p>You can, however, do all this on the <i>expo laptop</i> as this has already been configured with the right keys.
<dl>
<dt>expoweb (The data management system)</dt>
<dd>
<tt>hg clone ssh://expo@expo.survex.com/expoweb</tt> (read/write)<br />
<tt>hg clone http://expo.survex.com/repositories/home/expo/expoweb/</tt> (read-only checkout)
</dd>
<dt>troggle (The data management system backend)</dt>
<dd>
<tt>hg clone ssh://expo@expo.survex.com/troggle</tt> (read/write)<br />
<tt>hg clone http://expo.survex.com/repositories/home/expo/troggle/</tt> (read-only checkout)
</dd>
<dt>loser (The survey data)</dt>
<dd>
<tt>hg clone ssh://expo@expo.survex.com/loser</tt> (read/write)<br />
<tt>hg clone http://expo.survex.com/repositories/home/expo/loser/</tt> (read-only)
</dd>
<dt>tunneldata (The Tunnel drawings)</dt>
<dd>
<tt>hg clone ssh://expo@expo.survex.com/tunneldata</tt> (read/write)<br />
<tt>hg clone http://expo.survex.com/repositories/home/expo/expoweb/</tt> (read-only)
</dd>
</dl>
<h3><a id="Mercurialinwindows">Using Mercurial/TortoiseHg in Windows</a></h3>
<p>Read the instructions for setting up TortoiseHG in <a href="../tortoise/tortoise-win.htm">Tortoise-on-Windows</a>. But this won't work at all until you set up the key exchange using PuTty/Pageant.
<p>In Windows: install Mercurial and TortoiseHg of the relevant flavour from <a href="https://tortoisehg.bitbucket.io/">https://tortoisehg.bitbucket.io/</a> (ignoring antivirus/Windows warnings). This will install a submenu in your Programs menu)</p>
<p>To start cloning a repository: first create the folders you need for the repositories you are going to use, e.g. D:\CUCC-Expo\loser and D:\CUCC-Expo\expoweb. Then start TortoiseHg Workbench from your Programs menu, click File -> Clone repository, a dialogue box will appear. In the Source box type</p>
<p>What follows is for Linux. If you are running Windows then see below <a href="#Mercurialinwindows">Using Mercurial/TortoiseHg in Windows</a>.
<p>Mercurial can be used from the command line, but if you prefer a GUI, TourtoiseHg is highly recommended on all OSes.</p>
<p>Linux: Install mercurial and tortoisehg-nautilus from synaptic,
then restart nautilus <tt>nautilus -q</tt>. If it works, you'll be able to see the menus of tortoise within your Nautilus windows. </p>
<p>Once you've downloaded and installed a client, the first step is to create what is called a checkout of the data management system. This creates a copy on your machine which you can edit to your heart's content. The command to initially check out ('clone') the entire expo data management system is:</p>
<p><tt>hg clone ssh://expo@expo.survex.com/expoweb</tt></p>
<p>for subsequent updates</p>
<p><tt>hg update</tt></p>
<p>will generally do the trick.</p>
<p>In TortoiseHg, merely right-click on a folder you want to check out to, choose "Mercurial checkout," and enter</p>
<p><tt>ssh://expo@expo.survex.com/expoweb</tt></p>
<p>After you've made a change, commit it to you local copy with:</p>
<p><tt>hg commit</tt> (you can specify filenames to be specific)</p>
<p>or right clicking on the folder and going to commit in TortoiseHg. Mercurial can't always work out who you are. If you see a message like "abort: no username supplied" it was probably not set up to deduce that from your environment. It's easiest to give it the info in a config file at ~/.hgrc (create it if it doesn't exist, or add these lines if it already does) containing something like</p>
<p><tt>ssh://expo@expo.survex.com/expoweb</tt></p>
<p>for expoweb (or similar for the other repositories). In the Destination box type whatever destination you want your local copies to live in on your laptop e.g. D:\CUCC-Expo\expoweb. Hit Clone, and it should hopefully prompt you for the usual beery password.
<p>The first time you do this it will probably not work as it does not recognise the server. Fix this by running putty (downloading it from <a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/">https://www.chiark.greenend.org.uk/~sgtatham/putty/</a>), and connecting to the server 'expo@expo.survex.com' (on port 22). Confirm that this is the right server. If you succeed in getting a shell prompt then ssh connection are working and TortoiseHg should be able to clone the repo, and send changes back.</p>
<hr />
<div id="menu">
<ul id="links">
<li><a href="index.htm">Expedition Handbook</a>
</li>
<li><a href="../../infodx.htm">Main index</a></li>
</ul>
</div>
</body>
</html>