changeset 54:50db01566278

learn mercurial
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 14 Jan 2024 20:46:18 -0700
parents 3082eaf8457d
children 04501bde187d
files src/learn.html.luan
diffstat 1 files changed, 105 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
diff -r 3082eaf8457d -r 50db01566278 src/learn.html.luan
--- a/src/learn.html.luan	Wed Jan 10 12:59:16 2024 -0700
+++ b/src/learn.html.luan	Sun Jan 14 20:46:18 2024 -0700
@@ -55,7 +55,111 @@
 		title = [[Mercurial - Source Control]]
 		content = function()
 %>
-<p>later</p>
+<p>Thankfully <a href="mercurial.html">Mercurial</a> is well documented.  Read <a href="http://hgbook.red-bean.com/">Mercurial: The Definitive Guide</a> up to chapter 9.</p>
+
+<p>To get started with Mercurial, download Mercurial from <a href="https://www.mercurial-scm.org/">their website</a> and install it.  Then do:</p>
+
+<code block>
+~/learn $ hg version
+Mercurial Distributed SCM (version 5.2.2)
+(see https://mercurial-scm.org for more information)
+
+Copyright (C) 2005-2019 Matt Mackall and others
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+~/learn $ 
+</code>
+
+<p>If this works, it is installed properly.  Next <a href="http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html#sec:tour-basic:username">set up your Mercurial configuration file</a> which is <code>~/.hgrc</code> on a Mac or <code>/c/Users/$(whoami)/mercurial.ini</code> on Windows.  My <code>.hgrc</code> file looks like this:
+
+<code block>
+[ui]
+username = Franklin Schmidt <fschmidt@gmail.com>
+
+[auth]
+hghosting.prefix = https://hg.reactionary.software/repo/
+hghosting.username = fschmidt@gmail.com
+hghosting.password = xxxxxxxxxx
+
+[extensions]
+hgext.extdiff =
+
+[extdiff]
+cmd.dm = diffmerge
+</code>
+
+<p>You should register on <a href="https://hg.reactionary.software/">our Mercurial hosting service</a> and use your email as the username and the assigned password in <code>.hgrc</code>.  The last two blocks set up <code>hg dm</code> to call <a href="https://sourcegear.com/diffmerge/">DiffMerge</a>.</p>
+
+<p>Now you can play with <a href="https://hg.reactionary.software/repo/test/">https://hg.reactionary.software/repo/test/</a> like this:</p>
+
+<code block>
+~/learn $ hg clone https://hg.reactionary.software/repo/test/ hgtest1
+no changes found
+updating to branch default
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+~/learn $ hg clone https://hg.reactionary.software/repo/test/ hgtest2
+no changes found
+updating to branch default
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+~/learn $ ls -Fd h*
+hgtest1/	hgtest2/
+~/learn $ cd hgtest1
+~/learn/hgtest1 $ touch file.txt
+~/learn/hgtest1 $ e file.txt 
+~/learn/hgtest1 $ cat file.txt 
+some text
+~/learn/hgtest1 $ hg status
+? file.txt
+~/learn/hgtest1 $ hg add file.txt 
+~/learn/hgtest1 $ hg status
+A file.txt
+~/learn/hgtest1 $ hg pull
+pulling from https://hg.reactionary.software/repo/test/
+no changes found
+~/learn/hgtest1 $ hg commit -m 'add file.txt'
+~/learn/hgtest1 $ hg push
+pushing to https://hg.reactionary.software/repo/test/
+searching for changes
+remote: adding changesets
+remote: adding manifests
+remote: adding file changes
+remote: added 1 changesets with 1 changes to 1 files
+~/learn/hgtest1 $ cd ../hgtest2
+~/learn/hgtest2 $ hg pull
+pulling from https://hg.reactionary.software/repo/test/
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+new changesets aab34516d8dc
+(run 'hg update' to get a working copy)
+~/learn/hgtest2 $ hg update
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+~/learn/hgtest2 $ hg status
+~/learn/hgtest2 $ cat file.txt 
+some text
+~/learn/hgtest2 $ e file.txt 
+~/learn/hgtest2 $ cat file.txt 
+some text
+and more
+~/learn/hgtest2 $ hg status
+M file.txt
+~/learn/hgtest2 $ hg pull
+pulling from https://hg.reactionary.software/repo/test/
+searching for changes
+no changes found
+~/learn/hgtest2 $ hg dm
+~/learn/hgtest2 $ hg commit -m 'and more'
+~/learn/hgtest2 $ hg push
+pushing to https://hg.reactionary.software/repo/test/
+searching for changes
+remote: adding changesets
+remote: adding manifests
+remote: adding file changes
+remote: added 1 changesets with 1 changes to 1 files
+</code>
+
 <%
 		end
 	}