comparison src/learn.html.luan @ 54:50db01566278

learn mercurial
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 14 Jan 2024 20:46:18 -0700
parents 8e5ad4f564f5
children 51f75a9b4362
comparison
equal deleted inserted replaced
53:3082eaf8457d 54:50db01566278
53 } 53 }
54 hg = { 54 hg = {
55 title = [[Mercurial - Source Control]] 55 title = [[Mercurial - Source Control]]
56 content = function() 56 content = function()
57 %> 57 %>
58 <p>later</p> 58 <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>
59
60 <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>
61
62 <code block>
63 ~/learn $ hg version
64 Mercurial Distributed SCM (version 5.2.2)
65 (see https://mercurial-scm.org for more information)
66
67 Copyright (C) 2005-2019 Matt Mackall and others
68 This is free software; see the source for copying conditions. There is NO
69 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
70 ~/learn $
71 </code>
72
73 <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:
74
75 <code block>
76 [ui]
77 username = Franklin Schmidt <fschmidt@gmail.com>
78
79 [auth]
80 hghosting.prefix = https://hg.reactionary.software/repo/
81 hghosting.username = fschmidt@gmail.com
82 hghosting.password = xxxxxxxxxx
83
84 [extensions]
85 hgext.extdiff =
86
87 [extdiff]
88 cmd.dm = diffmerge
89 </code>
90
91 <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>
92
93 <p>Now you can play with <a href="https://hg.reactionary.software/repo/test/">https://hg.reactionary.software/repo/test/</a> like this:</p>
94
95 <code block>
96 ~/learn $ hg clone https://hg.reactionary.software/repo/test/ hgtest1
97 no changes found
98 updating to branch default
99 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 ~/learn $ hg clone https://hg.reactionary.software/repo/test/ hgtest2
101 no changes found
102 updating to branch default
103 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 ~/learn $ ls -Fd h*
105 hgtest1/ hgtest2/
106 ~/learn $ cd hgtest1
107 ~/learn/hgtest1 $ touch file.txt
108 ~/learn/hgtest1 $ e file.txt
109 ~/learn/hgtest1 $ cat file.txt
110 some text
111 ~/learn/hgtest1 $ hg status
112 ? file.txt
113 ~/learn/hgtest1 $ hg add file.txt
114 ~/learn/hgtest1 $ hg status
115 A file.txt
116 ~/learn/hgtest1 $ hg pull
117 pulling from https://hg.reactionary.software/repo/test/
118 no changes found
119 ~/learn/hgtest1 $ hg commit -m 'add file.txt'
120 ~/learn/hgtest1 $ hg push
121 pushing to https://hg.reactionary.software/repo/test/
122 searching for changes
123 remote: adding changesets
124 remote: adding manifests
125 remote: adding file changes
126 remote: added 1 changesets with 1 changes to 1 files
127 ~/learn/hgtest1 $ cd ../hgtest2
128 ~/learn/hgtest2 $ hg pull
129 pulling from https://hg.reactionary.software/repo/test/
130 requesting all changes
131 adding changesets
132 adding manifests
133 adding file changes
134 added 1 changesets with 1 changes to 1 files
135 new changesets aab34516d8dc
136 (run 'hg update' to get a working copy)
137 ~/learn/hgtest2 $ hg update
138 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 ~/learn/hgtest2 $ hg status
140 ~/learn/hgtest2 $ cat file.txt
141 some text
142 ~/learn/hgtest2 $ e file.txt
143 ~/learn/hgtest2 $ cat file.txt
144 some text
145 and more
146 ~/learn/hgtest2 $ hg status
147 M file.txt
148 ~/learn/hgtest2 $ hg pull
149 pulling from https://hg.reactionary.software/repo/test/
150 searching for changes
151 no changes found
152 ~/learn/hgtest2 $ hg dm
153 ~/learn/hgtest2 $ hg commit -m 'and more'
154 ~/learn/hgtest2 $ hg push
155 pushing to https://hg.reactionary.software/repo/test/
156 searching for changes
157 remote: adding changesets
158 remote: adding manifests
159 remote: adding file changes
160 remote: added 1 changesets with 1 changes to 1 files
161 </code>
162
59 <% 163 <%
60 end 164 end
61 } 165 }
62 html = { 166 html = {
63 title = [[HTML and CSS]] 167 title = [[HTML and CSS]]