Mercurial > hgbook
annotate en/ch02-tour-basic.xml @ 833:5225ec140003
Fix broken qguard example
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 14 May 2009 21:06:12 -0700 |
parents | acf9dc5f088d |
children |
rev | line source |
---|---|
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1 <!-- vim: set filetype=docbkxml shiftwidth=2 autoindent expandtab tw=77 : --> |
84 | 2 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
3 <chapter id="chap:tour-basic"> |
671
13513d2a128d
Add sensible names to chapters.
Bryan O'Sullivan <bos@serpentine.com>
parents:
665
diff
changeset
|
4 <?dbhtml filename="a-tour-of-mercurial-the-basics.html"?> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
5 <title>A tour of Mercurial: the basics</title> |
84 | 6 |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
7 <sect1 id="sec:tour:install"> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
8 <title>Installing Mercurial on your system</title> |
85
b7c69a68b0cc
A little progress on "lightning tour".
Bryan O'Sullivan <bos@serpentine.com>
parents:
84
diff
changeset
|
9 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
10 <para id="x_1">Prebuilt binary packages of Mercurial are available for |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
11 every popular operating system. These make it easy to start |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
12 using Mercurial on your computer immediately.</para> |
84 | 13 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
14 <sect2> |
714 | 15 <title>Windows</title> |
16 | |
17 <para id="x_c">The best version of Mercurial for Windows is | |
18 TortoiseHg, which can be found at <ulink | |
19 url="http://bitbucket.org/tortoisehg/stable/wiki/Home">http://bitbucket.org/tortoisehg/stable/wiki/Home</ulink>. | |
20 This package has no external dependencies; it <quote>just | |
21 works</quote>. It provides both command line and graphical | |
22 user interfaces.</para> | |
23 | |
24 </sect2> | |
25 | |
26 <sect2> | |
27 <title>Mac OS X</title> | |
28 | |
29 <para id="x_a">Lee Cantey publishes an installer of Mercurial | |
30 for Mac OS X at <ulink | |
31 url="http://mercurial.berkwood.com">http://mercurial.berkwood.com</ulink>.</para> | |
32 </sect2> | |
33 | |
34 <sect2> | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
35 <title>Linux</title> |
84 | 36 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
37 <para id="x_2">Because each Linux distribution has its own packaging |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
38 tools, policies, and rate of development, it's difficult to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
39 give a comprehensive set of instructions on how to install |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
40 Mercurial binaries. The version of Mercurial that you will |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
41 end up with can vary depending on how active the person is who |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
42 maintains the package for your distribution.</para> |
84 | 43 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
44 <para id="x_3">To keep things simple, I will focus on installing |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
45 Mercurial from the command line under the most popular Linux |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
46 distributions. Most of these distributions provide graphical |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
47 package managers that will let you install Mercurial with a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
48 single click; the package name to look for is |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
49 <literal>mercurial</literal>.</para> |
84 | 50 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
51 <itemizedlist> |
714 | 52 <listitem><para id="x_4">Ubuntu and Debian:</para> |
679
80928ea6e7ae
Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents:
671
diff
changeset
|
53 <programlisting>apt-get install mercurial</programlisting></listitem> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
54 <listitem><para id="x_5">Fedora:</para> |
679
80928ea6e7ae
Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents:
671
diff
changeset
|
55 <programlisting>yum install mercurial</programlisting></listitem> |
825 | 56 <listitem><para id="x_715">OpenSUSE:</para> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
57 <programlisting>zypper install mercurial</programlisting></listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
58 <listitem><para id="x_6">Gentoo:</para> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
59 <programlisting>emerge mercurial</programlisting></listitem> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
60 </itemizedlist> |
84 | 61 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
62 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
63 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
64 <title>Solaris</title> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
65 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
66 <para id="x_9">SunFreeWare, at <ulink |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
67 url="http://www.sunfreeware.com">http://www.sunfreeware.com</ulink>, |
714 | 68 provides prebuilt packages of Mercurial.</para> |
84 | 69 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
70 </sect2> |
84 | 71 |
714 | 72 </sect1> |
412 | 73 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
74 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
75 <title>Getting started</title> |
84 | 76 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
77 <para id="x_e">To begin, we'll use the <command role="hg-cmd">hg |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
78 version</command> command to find out whether Mercurial is |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
79 installed properly. The actual version information that it |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
80 prints isn't so important; we simply care whether the command |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
81 runs and prints anything at all.</para> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
82 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
83 &interaction.tour.version; |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
84 |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
85 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
86 <title>Built-in help</title> |
87 | 87 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
88 <para id="x_f">Mercurial provides a built-in help system. This is |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
89 invaluable for those times when you find yourself stuck |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
90 trying to remember how to run a command. If you are |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
91 completely stuck, simply run <command role="hg-cmd">hg |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
92 help</command>; it will print a brief list of commands, |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
93 along with a description of what each does. If you ask for |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
94 help on a specific command (as below), it prints more |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
95 detailed information.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
96 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
97 &interaction.tour.help; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
98 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
99 <para id="x_10">For a more impressive level of detail (which you won't |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
100 usually need) run <command role="hg-cmd">hg help <option |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
101 role="hg-opt-global">-v</option></command>. The <option |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
102 role="hg-opt-global">-v</option> option is short for |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
103 <option role="hg-opt-global">--verbose</option>, and tells |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
104 Mercurial to print more information than it usually |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
105 would.</para> |
87 | 106 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
107 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
108 </sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
109 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
110 <title>Working with a repository</title> |
87 | 111 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
112 <para id="x_11">In Mercurial, everything happens inside a |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
113 <emphasis>repository</emphasis>. The repository for a project |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
114 contains all of the files that <quote>belong to</quote> that |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
115 project, along with a historical record of the project's |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
116 files.</para> |
87 | 117 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
118 <para id="x_12">There's nothing particularly magical about a repository; it |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
119 is simply a directory tree in your filesystem that Mercurial |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
120 treats as special. You can rename or delete a repository any |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
121 time you like, using either the command line or your file |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
122 browser.</para> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
123 |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
124 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
125 <title>Making a local copy of a repository</title> |
87 | 126 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
127 <para id="x_13"><emphasis>Copying</emphasis> a repository is just a little |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
128 bit special. While you could use a normal file copying |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
129 command to make a copy of a repository, it's best to use a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
130 built-in command that Mercurial provides. This command is |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
131 called <command role="hg-cmd">hg clone</command>, because it |
714 | 132 makes an identical copy of an existing repository.</para> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
133 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
134 &interaction.tour.clone; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
135 |
775 | 136 <para id="x_67c">One advantage of using <command role="hg-cmd">hg |
714 | 137 clone</command> is that, as we can see above, it lets us clone |
138 repositories over the network. Another is that it remembers | |
139 where we cloned from, which we'll find useful soon when we | |
140 want to fetch new changes from another repository.</para> | |
141 | |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
142 <para id="x_14">If our clone succeeded, we should now have a local |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
143 directory called <filename class="directory">hello</filename>. |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
144 This directory will contain some files.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
145 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
146 &interaction.tour.ls; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
147 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
148 <para id="x_15">These files have the same contents and history in our |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
149 repository as they do in the repository we cloned.</para> |
87 | 150 |
714 | 151 <para id="x_16">Every Mercurial repository is complete, |
152 self-contained, and independent. It contains its own private | |
153 copy of a project's files and history. As we just mentioned, | |
154 a cloned repository remembers the location of the repository | |
155 it was cloned from, but Mercurial will not communicate with | |
156 that repository, or any other, unless you tell it to.</para> | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
157 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
158 <para id="x_17">What this means for now is that we're free to experiment |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
159 with our repository, safe in the knowledge that it's a private |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
160 <quote>sandbox</quote> that won't affect anyone else.</para> |
87 | 161 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
162 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
163 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
164 <title>What's in a repository?</title> |
87 | 165 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
166 <para id="x_18">When we take a more detailed look inside a repository, we |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
167 can see that it contains a directory named <filename |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
168 class="directory">.hg</filename>. This is where Mercurial |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
169 keeps all of its metadata for the repository.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
170 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
171 &interaction.tour.ls-a; |
85
b7c69a68b0cc
A little progress on "lightning tour".
Bryan O'Sullivan <bos@serpentine.com>
parents:
84
diff
changeset
|
172 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
173 <para id="x_19">The contents of the <filename |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
174 class="directory">.hg</filename> directory and its |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
175 subdirectories are private to Mercurial. Every other file and |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
176 directory in the repository is yours to do with as you |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
177 please.</para> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
178 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
179 <para id="x_1a">To introduce a little terminology, the <filename |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
180 class="directory">.hg</filename> directory is the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
181 <quote>real</quote> repository, and all of the files and |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
182 directories that coexist with it are said to live in the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
183 <emphasis>working directory</emphasis>. An easy way to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
184 remember the distinction is that the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
185 <emphasis>repository</emphasis> contains the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
186 <emphasis>history</emphasis> of your project, while the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
187 <emphasis>working directory</emphasis> contains a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
188 <emphasis>snapshot</emphasis> of your project at a particular |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
189 point in history.</para> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
190 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
191 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
192 </sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
193 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
194 <title>A tour through history</title> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
195 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
196 <para id="x_1b">One of the first things we might want to do with a new, |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
197 unfamiliar repository is understand its history. The <command |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
198 role="hg-cmd">hg log</command> command gives us a view of |
714 | 199 the history of changes in the repository.</para> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
200 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
201 &interaction.tour.log; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
202 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
203 <para id="x_1c">By default, this command prints a brief paragraph of output |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
204 for each change to the project that was recorded. In Mercurial |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
205 terminology, we call each of these recorded events a |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
206 <emphasis>changeset</emphasis>, because it can contain a record |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
207 of changes to several files.</para> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
208 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
209 <para id="x_1d">The fields in a record of output from <command |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
210 role="hg-cmd">hg log</command> are as follows.</para> |
714 | 211 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
212 <itemizedlist> |
714 | 213 <listitem><para id="x_1e"><literal>changeset</literal>: This |
214 field has the format of a number, followed by a colon, | |
215 followed by a hexadecimal (or <emphasis>hex</emphasis>) | |
216 string. These are <emphasis>identifiers</emphasis> for the | |
217 changeset. The hex string is a unique identifier: the same | |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
218 hex string will always refer to the same changeset in every |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
219 copy of this repository. The |
714 | 220 number is shorter and easier to type than the hex string, |
221 but it isn't unique: the same number in two different clones | |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
222 of a repository may identify different changesets.</para> |
714 | 223 </listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
224 <listitem><para id="x_1f"><literal>user</literal>: The identity of the |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
225 person who created the changeset. This is a free-form |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
226 field, but it most often contains a person's name and email |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
227 address.</para></listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
228 <listitem><para id="x_20"><literal>date</literal>: The date and time on |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
229 which the changeset was created, and the timezone in which |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
230 it was created. (The date and time are local to that |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
231 timezone; they display what time and date it was for the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
232 person who created the changeset.)</para></listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
233 <listitem><para id="x_21"><literal>summary</literal>: The first line of |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
234 the text message that the creator of the changeset entered |
714 | 235 to describe the changeset.</para></listitem> |
236 <listitem> | |
775 | 237 <para id="x_67d">Some changesets, such as the first in the list above, |
714 | 238 have a <literal>tag</literal> field. A tag is another way |
239 to identify a changeset, by giving it an easy-to-remember | |
240 name. (The tag named <literal>tip</literal> is special: it | |
241 always refers to the newest change in a repository.)</para> | |
242 </listitem> | |
243 </itemizedlist> | |
244 | |
245 <para id="x_22">The default output printed by <command | |
246 role="hg-cmd">hg log</command> is purely a summary; it is | |
247 missing a lot of detail.</para> | |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
248 |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
249 <para id="x_23"><xref linkend="fig:tour-basic:history"/> provides |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
250 a graphical representation of the history of the <filename |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
251 class="directory">hello</filename> repository, to make it a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
252 little easier to see which direction history is |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
253 <quote>flowing</quote> in. We'll be returning to this figure |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
254 several times in this chapter and the chapter that |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
255 follows.</para> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
256 |
690
b788b405e141
Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents:
683
diff
changeset
|
257 <figure id="fig:tour-basic:history"> |
b788b405e141
Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents:
683
diff
changeset
|
258 <title>Graphical history of the <filename |
b788b405e141
Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents:
683
diff
changeset
|
259 class="directory">hello</filename> repository</title> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
260 <mediaobject> |
693
0b45854f0b7b
Generate and include images properly.
Bryan O'Sullivan <bos@serpentine.com>
parents:
691
diff
changeset
|
261 <imageobject><imagedata fileref="figs/tour-history.png"/></imageobject> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
262 <textobject><phrase>XXX add text</phrase></textobject> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
263 </mediaobject> |
690
b788b405e141
Replace uses of <informalfigure> with <figure>
Bryan O'Sullivan <bos@serpentine.com>
parents:
683
diff
changeset
|
264 </figure> |
96
7d7ddc3a57af
Split tour into two chapters.
Bryan O'Sullivan <bos@serpentine.com>
parents:
95
diff
changeset
|
265 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
266 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
267 <title>Changesets, revisions, and talking to other |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
268 people</title> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
269 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
270 <para id="x_25">As English is a notoriously sloppy language, and computer |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
271 science has a hallowed history of terminological confusion |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
272 (why use one term when four will do?), revision control has a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
273 variety of words and phrases that mean the same thing. If you |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
274 are talking about Mercurial history with other people, you |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
275 will find that the word <quote>changeset</quote> is often |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
276 compressed to <quote>change</quote> or (when written) |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
277 <quote>cset</quote>, and sometimes a changeset is referred to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
278 as a <quote>revision</quote> or a <quote>rev</quote>.</para> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
279 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
280 <para id="x_26">While it doesn't matter what <emphasis>word</emphasis> you |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
281 use to refer to the concept of <quote>a changeset</quote>, the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
282 <emphasis>identifier</emphasis> that you use to refer to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
283 <quote>a <emphasis>specific</emphasis> changeset</quote> is of |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
284 great importance. Recall that the <literal>changeset</literal> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
285 field in the output from <command role="hg-cmd">hg |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
286 log</command> identifies a changeset using both a number and |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
287 a hexadecimal string.</para> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
288 <itemizedlist> |
714 | 289 <listitem><para id="x_27">The revision number is a handy |
290 notation that is <emphasis>only valid in that | |
291 repository</emphasis>.</para></listitem> | |
292 <listitem><para id="x_28">The hexadecimal string is the | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
293 <emphasis>permanent, unchanging identifier</emphasis> that |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
294 will always identify that exact changeset in |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
295 <emphasis>every</emphasis> copy of the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
296 repository.</para></listitem></itemizedlist> |
714 | 297 |
298 <para id="x_29">This distinction is important. If you send | |
299 someone an email talking about <quote>revision 33</quote>, | |
300 there's a high likelihood that their revision 33 will | |
301 <emphasis>not be the same</emphasis> as yours. The reason for | |
302 this is that a revision number depends on the order in which | |
303 changes arrived in a repository, and there is no guarantee | |
304 that the same changes will happen in the same order in | |
305 different repositories. Three changes <literal>a,b,c</literal> | |
306 can easily appear in one repository as | |
307 <literal>0,1,2</literal>, while in another as | |
308 <literal>0,2,1</literal>.</para> | |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
309 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
310 <para id="x_2a">Mercurial uses revision numbers purely as a convenient |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
311 shorthand. If you need to discuss a changeset with someone, |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
312 or make a record of a changeset for some other reason (for |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
313 example, in a bug report), use the hexadecimal |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
314 identifier.</para> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
315 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
316 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
317 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
318 <title>Viewing specific revisions</title> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
319 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
320 <para id="x_2b">To narrow the output of <command role="hg-cmd">hg |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
321 log</command> down to a single revision, use the <option |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
322 role="hg-opt-log">-r</option> (or <option |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
323 role="hg-opt-log">--rev</option>) option. You can use |
714 | 324 either a revision number or a hexadecimal identifier, |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
325 and you can provide as many revisions as you want.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
326 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
327 &interaction.tour.log-r; |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
328 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
329 <para id="x_2c">If you want to see the history of several revisions |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
330 without having to list each one, you can use <emphasis>range |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
331 notation</emphasis>; this lets you express the idea <quote>I |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
332 want all revisions between <literal>abc</literal> and |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
333 <literal>def</literal>, inclusive</quote>.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
334 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
335 &interaction.tour.log.range; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
336 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
337 <para id="x_2d">Mercurial also honours the order in which you specify |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
338 revisions, so <command role="hg-cmd">hg log -r 2:4</command> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
339 prints 2, 3, and 4. while <command role="hg-cmd">hg log -r |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
340 4:2</command> prints 4, 3, and 2.</para> |
88
d351032c189c
Progress with log coverage.
Bryan O'Sullivan <bos@serpentine.com>
parents:
87
diff
changeset
|
341 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
342 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
343 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
344 <title>More detailed information</title> |
91 | 345 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
346 <para id="x_2e">While the summary information printed by <command |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
347 role="hg-cmd">hg log</command> is useful if you already know |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
348 what you're looking for, you may need to see a complete |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
349 description of the change, or a list of the files changed, if |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
350 you're trying to decide whether a changeset is the one you're |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
351 looking for. The <command role="hg-cmd">hg log</command> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
352 command's <option role="hg-opt-global">-v</option> (or <option |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
353 role="hg-opt-global">--verbose</option>) option gives you |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
354 this extra detail.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
355 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
356 &interaction.tour.log-v; |
91 | 357 |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
358 <para id="x_2f">If you want to see both the description and |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
359 content of a change, add the <option |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
360 role="hg-opt-log">-p</option> (or <option |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
361 role="hg-opt-log">--patch</option>) option. This displays |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
362 the content of a change as a <emphasis>unified diff</emphasis> |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
363 (if you've never seen a unified diff before, see <xref |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
364 linkend="sec:mq:patch"/> for an overview).</para> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
365 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
366 &interaction.tour.log-vp; |
91 | 367 |
775 | 368 <para id="x_67e">The <option role="hg-opt-log">-p</option> option is |
714 | 369 tremendously useful, so it's well worth remembering.</para> |
370 | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
371 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
372 </sect1> |
714 | 373 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
374 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
375 <title>All about command options</title> |
91 | 376 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
377 <para id="x_30">Let's take a brief break from exploring Mercurial commands |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
378 to discuss a pattern in the way that they work; you may find |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
379 this useful to keep in mind as we continue our tour.</para> |
91 | 380 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
381 <para id="x_31">Mercurial has a consistent and straightforward approach to |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
382 dealing with the options that you can pass to commands. It |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
383 follows the conventions for options that are common to modern |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
384 Linux and Unix systems.</para> |
714 | 385 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
386 <itemizedlist> |
714 | 387 <listitem> |
388 <para id="x_32">Every option has a long name. For example, as | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
389 we've already seen, the <command role="hg-cmd">hg |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
390 log</command> command accepts a <option |
714 | 391 role="hg-opt-log">--rev</option> option.</para> |
392 </listitem> | |
393 <listitem> | |
394 <para id="x_33">Most options have short names, too. Instead | |
395 of <option role="hg-opt-log">--rev</option>, we can use | |
396 <option role="hg-opt-log">-r</option>. (The reason that | |
397 some options don't have short names is that the options in | |
398 question are rarely used.)</para> | |
399 </listitem> | |
400 <listitem> | |
401 <para id="x_34">Long options start with two dashes (e.g. | |
402 <option role="hg-opt-log">--rev</option>), while short | |
403 options start with one (e.g. <option | |
404 role="hg-opt-log">-r</option>).</para> | |
405 </listitem> | |
406 <listitem> | |
407 <para id="x_35">Option naming and usage is consistent across | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
408 commands. For example, every command that lets you specify |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
409 a changeset ID or revision number accepts both <option |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
410 role="hg-opt-log">-r</option> and <option |
714 | 411 role="hg-opt-log">--rev</option> arguments.</para> |
412 </listitem> | |
413 <listitem> | |
775 | 414 <para id="x_67f">If you are using short options, you can save typing by |
714 | 415 running them together. For example, the command <command |
416 role="hg-cmd">hg log -v -p -r 2</command> can be written | |
417 as <command role="hg-cmd">hg log -vpr2</command>.</para> | |
418 </listitem> | |
419 </itemizedlist> | |
420 | |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
421 <para id="x_36">In the examples throughout this book, I usually |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
422 use short options instead of long. This simply reflects my own |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
423 preference, so don't read anything significant into it.</para> |
91 | 424 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
425 <para id="x_37">Most commands that print output of some kind will print more |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
426 output when passed a <option role="hg-opt-global">-v</option> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
427 (or <option role="hg-opt-global">--verbose</option>) option, and |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
428 less when passed <option role="hg-opt-global">-q</option> (or |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
429 <option role="hg-opt-global">--quiet</option>).</para> |
91 | 430 |
714 | 431 <note> |
432 <title>Option naming consistency</title> | |
433 | |
775 | 434 <para id="x_680">Almost always, Mercurial commands use consistent option |
714 | 435 names to refer to the same concepts. For instance, if a |
436 command deals with changesets, you'll always identify them | |
437 with <option role="hg-opt-log">--rev</option> or <option | |
438 role="hg-opt-log">-r</option>. This consistent use of | |
439 option names makes it easier to remember what options a | |
440 particular command takes.</para> | |
441 </note> | |
442 | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
443 </sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
444 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
445 <title>Making and reviewing changes</title> |
91 | 446 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
447 <para id="x_38">Now that we have a grasp of viewing history in Mercurial, |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
448 let's take a look at making some changes and examining |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
449 them.</para> |
91 | 450 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
451 <para id="x_39">The first thing we'll do is isolate our experiment in a |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
452 repository of its own. We use the <command role="hg-cmd">hg |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
453 clone</command> command, but we don't need to clone a copy of |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
454 the remote repository. Since we already have a copy of it |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
455 locally, we can just clone that instead. This is much faster |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
456 than cloning over the network, and cloning a local repository |
714 | 457 uses less disk space in most cases, too<footnote> |
775 | 458 <para id="x_681">The saving of space arises when source and destination |
714 | 459 repositories are on the same filesystem, in which case |
460 Mercurial will use hardlinks to do copy-on-write sharing of | |
461 its internal metadata. If that explanation meant nothing to | |
462 you, don't worry: everything happens transparently and | |
463 automatically, and you don't need to understand it.</para> | |
464 </footnote>.</para> | |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
465 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
466 &interaction.tour.reclone; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
467 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
468 <para id="x_3a">As an aside, it's often good practice to keep a |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
469 <quote>pristine</quote> copy of a remote repository around, |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
470 which you can then make temporary clones of to create sandboxes |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
471 for each task you want to work on. This lets you work on |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
472 multiple tasks in parallel, each isolated from the others until |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
473 it's complete and you're ready to integrate it back. Because |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
474 local clones are so cheap, there's almost no overhead to cloning |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
475 and destroying repositories whenever you want.</para> |
91 | 476 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
477 <para id="x_3b">In our <filename class="directory">my-hello</filename> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
478 repository, we have a file <filename>hello.c</filename> that |
714 | 479 contains the classic <quote>hello, world</quote> program.</para> |
480 | |
481 &interaction.tour.cat1; | |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
482 |
775 | 483 <para id="x_682">Let's edit this file so that it prints a second line of |
714 | 484 output.</para> |
485 | |
486 &interaction.tour.cat2; | |
91 | 487 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
488 <para id="x_3c">Mercurial's <command role="hg-cmd">hg status</command> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
489 command will tell us what Mercurial knows about the files in the |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
490 repository.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
491 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
492 &interaction.tour.status; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
493 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
494 <para id="x_3d">The <command role="hg-cmd">hg status</command> command |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
495 prints no output for some files, but a line starting with |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
496 <quote><literal>M</literal></quote> for |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
497 <filename>hello.c</filename>. Unless you tell it to, <command |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
498 role="hg-cmd">hg status</command> will not print any output |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
499 for files that have not been modified.</para> |
91 | 500 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
501 <para id="x_3e">The <quote><literal>M</literal></quote> indicates that |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
502 Mercurial has noticed that we modified |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
503 <filename>hello.c</filename>. We didn't need to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
504 <emphasis>inform</emphasis> Mercurial that we were going to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
505 modify the file before we started, or that we had modified the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
506 file after we were done; it was able to figure this out |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
507 itself.</para> |
91 | 508 |
714 | 509 <para id="x_3f">It's somewhat helpful to know that we've modified |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
510 <filename>hello.c</filename>, but we might prefer to know |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
511 exactly <emphasis>what</emphasis> changes we've made to it. To |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
512 do this, we use the <command role="hg-cmd">hg diff</command> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
513 command.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
514 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
515 &interaction.tour.diff; |
91 | 516 |
714 | 517 <tip> |
518 <title>Understanding patches</title> | |
519 | |
775 | 520 <para id="x_683">Remember to take a look at <xref |
714 | 521 linkend="sec:mq:patch"/> if you don't know how to read |
522 output above.</para> | |
523 </tip> | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
524 </sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
525 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
526 <title>Recording changes in a new changeset</title> |
91 | 527 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
528 <para id="x_40">We can modify files, build and test our changes, and use |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
529 <command role="hg-cmd">hg status</command> and <command |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
530 role="hg-cmd">hg diff</command> to review our changes, until |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
531 we're satisfied with what we've done and arrive at a natural |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
532 stopping point where we want to record our work in a new |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
533 changeset.</para> |
91 | 534 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
535 <para id="x_41">The <command role="hg-cmd">hg commit</command> command lets |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
536 us create a new changeset; we'll usually refer to this as |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
537 <quote>making a commit</quote> or |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
538 <quote>committing</quote>.</para> |
91 | 539 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
540 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
541 <title>Setting up a username</title> |
102 | 542 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
543 <para id="x_42">When you try to run <command role="hg-cmd">hg |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
544 commit</command> for the first time, it is not guaranteed to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
545 succeed. Mercurial records your name and address with each |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
546 change that you commit, so that you and others will later be |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
547 able to tell who made each change. Mercurial tries to |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
548 automatically figure out a sensible username to commit the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
549 change with. It will attempt each of the following methods, |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
550 in order:</para> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
551 <orderedlist> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
552 <listitem><para id="x_43">If you specify a <option |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
553 role="hg-opt-commit">-u</option> option to the <command |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
554 role="hg-cmd">hg commit</command> command on the command |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
555 line, followed by a username, this is always given the |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
556 highest precedence.</para></listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
557 <listitem><para id="x_44">If you have set the <envar>HGUSER</envar> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
558 environment variable, this is checked |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
559 next.</para></listitem> |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
560 <listitem><para id="x_45">If you create a file in your home |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
561 directory called <filename |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
562 role="special">.hgrc</filename>, with a <envar |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
563 role="rc-item-ui">username</envar> entry, that will be |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
564 used next. To see what the contents of this file should |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
565 look like, refer to <xref |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
566 linkend="sec:tour-basic:username"/> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
567 below.</para></listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
568 <listitem><para id="x_46">If you have set the <envar>EMAIL</envar> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
569 environment variable, this will be used |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
570 next.</para></listitem> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
571 <listitem><para id="x_47">Mercurial will query your system to find out |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
572 your local user name and host name, and construct a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
573 username from these components. Since this often results |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
574 in a username that is not very useful, it will print a |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
575 warning if it has to do |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
576 this.</para></listitem> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
577 </orderedlist> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
578 <para id="x_48">If all of these mechanisms fail, Mercurial will |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
579 fail, printing an error message. In this case, it will not |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
580 let you commit until you set up a |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
581 username.</para> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
582 <para id="x_49">You should think of the <envar>HGUSER</envar> environment |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
583 variable and the <option role="hg-opt-commit">-u</option> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
584 option to the <command role="hg-cmd">hg commit</command> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
585 command as ways to <emphasis>override</emphasis> Mercurial's |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
586 default selection of username. For normal use, the simplest |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
587 and most robust way to set a username for yourself is by |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
588 creating a <filename role="special">.hgrc</filename> file; see |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
589 below for details.</para> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
590 <sect3 id="sec:tour-basic:username"> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
591 <title>Creating a Mercurial configuration file</title> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
592 |
773 | 593 <para id="x_4a">To set a user name, use your favorite editor |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
594 to create a file called <filename |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
595 role="special">.hgrc</filename> in your home directory. |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
596 Mercurial will use this file to look up your personalised |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
597 configuration settings. The initial contents of your |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
598 <filename role="special">.hgrc</filename> should look like |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
599 this.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
600 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
601 <tip> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
602 <title><quote>Home directory</quote> on Windows</title> |
714 | 603 |
825 | 604 <para id="x_716">When we refer to your home directory, on an English |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
605 language installation of Windows this will usually be a |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
606 folder named after your user name in |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
607 <filename>C:\Documents and Settings</filename>. You can |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
608 find out the exact name of your home directory by opening |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
609 a command prompt window and running the following |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
610 command.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
611 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
612 <screen><prompt>C:\></prompt> <userinput>echo %UserProfile%</userinput></screen> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
613 </tip> |
714 | 614 |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
615 <programlisting># This is a Mercurial configuration file. |
679
80928ea6e7ae
Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents:
671
diff
changeset
|
616 [ui] |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
617 username = Firstname Lastname <email.address@example.net></programlisting> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
618 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
619 <para id="x_4b">The <quote><literal>[ui]</literal></quote> line begins a |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
620 <emphasis>section</emphasis> of the config file, so you can |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
621 read the <quote><literal>username = ...</literal></quote> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
622 line as meaning <quote>set the value of the |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
623 <literal>username</literal> item in the |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
624 <literal>ui</literal> section</quote>. A section continues |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
625 until a new section begins, or the end of the file. |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
626 Mercurial ignores empty lines and treats any text from |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
627 <quote><literal>#</literal></quote> to the end of a line as |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
628 a comment.</para> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
629 </sect3> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
630 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
631 <sect3> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
632 <title>Choosing a user name</title> |
102 | 633 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
634 <para id="x_4c">You can use any text you like as the value of |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
635 the <literal>username</literal> config item, since this |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
636 information is for reading by other people, but will not be |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
637 interpreted by Mercurial. The convention that most people |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
638 follow is to use their name and email address, as in the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
639 example above.</para> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
640 <note> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
641 <para id="x_4d">Mercurial's built-in web server obfuscates |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
642 email addresses, to make it more difficult for the email |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
643 harvesting tools that spammers use. This reduces the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
644 likelihood that you'll start receiving more junk email if |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
645 you publish a Mercurial repository on the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
646 web.</para></note> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
647 </sect3> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
648 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
649 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
650 <title>Writing a commit message</title> |
102 | 651 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
652 <para id="x_4e">When we commit a change, Mercurial drops us into |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
653 a text editor, to enter a message that will describe the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
654 modifications we've made in this changeset. This is called |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
655 the <emphasis>commit message</emphasis>. It will be a record |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
656 for readers of what we did and why, and it will be printed by |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
657 <command role="hg-cmd">hg log</command> after we've finished |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
658 committing.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
659 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
660 &interaction.tour.commit; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
661 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
662 <para id="x_4f">The editor that the <command role="hg-cmd">hg |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
663 commit</command> command drops us into will contain an empty |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
664 line or two, followed by a number of lines starting with |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
665 <quote><literal>HG:</literal></quote>.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
666 |
714 | 667 <programlisting> |
668 This is where I type my commit comment. | |
669 | |
670 HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
671 HG: -- | |
672 HG: user: Bryan O'Sullivan <bos@serpentine.com> | |
673 HG: branch 'default' | |
674 HG: changed hello.c</programlisting> | |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
675 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
676 <para id="x_50">Mercurial ignores the lines that start with |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
677 <quote><literal>HG:</literal></quote>; it uses them only to |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
678 tell us which files it's recording changes to. Modifying or |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
679 deleting these lines has no effect.</para> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
680 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
681 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
682 <title>Writing a good commit message</title> |
91 | 683 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
684 <para id="x_51">Since <command role="hg-cmd">hg log</command> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
685 only prints the first line of a commit message by default, |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
686 it's best to write a commit message whose first line stands |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
687 alone. Here's a real example of a commit message that |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
688 <emphasis>doesn't</emphasis> follow this guideline, and hence |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
689 has a summary that is not readable.</para> |
91 | 690 |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
691 <programlisting> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
692 changeset: 73:584af0e231be |
679
80928ea6e7ae
Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents:
671
diff
changeset
|
693 user: Censored Person <censored.person@example.org> |
80928ea6e7ae
Add the ability to include text files and have them XML-mangled.
Bryan O'Sullivan <bos@serpentine.com>
parents:
671
diff
changeset
|
694 date: Tue Sep 26 21:37:07 2006 -0700 |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
695 summary: include buildmeister/commondefs. Add exports.</programlisting> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
696 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
697 <para id="x_52">As far as the remainder of the contents of the |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
698 commit message are concerned, there are no hard-and-fast |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
699 rules. Mercurial itself doesn't interpret or care about the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
700 contents of the commit message, though your project may have |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
701 policies that dictate a certain kind of formatting.</para> |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
702 <para id="x_53">My personal preference is for short, but |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
703 informative, commit messages that tell me something that I |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
704 can't figure out with a quick glance at the output of <command |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
705 role="hg-cmd">hg log --patch</command>.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
706 <para id="x_55">If we run the <command role="hg-cmd">hg |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
707 commit</command> command without any arguments, it records |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
708 all of the changes we've made, as reported by <command |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
709 role="hg-cmd">hg status</command> and <command |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
710 role="hg-cmd">hg diff</command>.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
711 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
712 <note> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
713 <title>A surprise for Subversion users</title> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
714 |
825 | 715 <para id="x_717">Like other Mercurial commands, if we don't supply |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
716 explicit names to commit to the <command role="hg-cmd">hg |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
717 commit</command>, it will operate across a repository's |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
718 entire working directory. Be wary of this if you're coming |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
719 from the Subversion or CVS world, since you might expect it |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
720 to operate only on the current directory that you happen to |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
721 be visiting and its subdirectories.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
722 </note> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
723 </sect2> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
724 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
725 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
726 <title>Aborting a commit</title> |
91 | 727 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
728 <para id="x_54">If you decide that you don't want to commit |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
729 while in the middle of editing a commit message, simply exit |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
730 from your editor without saving the file that it's editing. |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
731 This will cause nothing to happen to either the repository or |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
732 the working directory.</para> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
733 </sect2> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
734 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
735 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
736 <title>Admiring our new handiwork</title> |
91 | 737 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
738 <para id="x_56">Once we've finished the commit, we can use the |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
739 <command role="hg-cmd">hg tip</command> command to display the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
740 changeset we just created. This command produces output that |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
741 is identical to <command role="hg-cmd">hg log</command>, but |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
742 it only displays the newest revision in the repository.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
743 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
744 &interaction.tour.tip; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
745 |
714 | 746 <para id="x_57">We refer to the newest revision in the |
747 repository as the <emphasis>tip revision</emphasis>, or simply | |
748 the <emphasis>tip</emphasis>.</para> | |
749 | |
775 | 750 <para id="x_684">By the way, the <command role="hg-cmd">hg tip</command> |
714 | 751 command accepts many of the same options as <command |
752 role="hg-cmd">hg log</command>, so <option | |
753 role="hg-opt-global">-v</option> above indicates <quote>be | |
754 verbose</quote>, <option role="hg-opt-tip">-p</option> | |
755 specifies <quote>print a patch</quote>. The use of <option | |
756 role="hg-opt-tip">-p</option> to print patches is another | |
757 example of the consistent naming we mentioned earlier.</para> | |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
758 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
759 </sect1> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
760 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
761 <sect1> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
762 <title>Sharing changes</title> |
91 | 763 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
764 <para id="x_58">We mentioned earlier that repositories in |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
765 Mercurial are self-contained. This means that the changeset we |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
766 just created exists only in our <filename |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
767 class="directory">my-hello</filename> repository. Let's look |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
768 at a few ways that we can propagate this change into other |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
769 repositories.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
770 |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
771 <sect2 id="sec:tour:pull"> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
772 <title>Pulling changes from another repository</title> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
773 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
774 <para id="x_59">To get started, let's clone our original |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
775 <filename class="directory">hello</filename> repository, which |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
776 does not contain the change we just committed. We'll call our |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
777 temporary repository <filename |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
778 class="directory">hello-pull</filename>.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
779 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
780 &interaction.tour.clone-pull; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
781 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
782 <para id="x_5a">We'll use the <command role="hg-cmd">hg |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
783 pull</command> command to bring changes from <filename |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
784 class="directory">my-hello</filename> into <filename |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
785 class="directory">hello-pull</filename>. However, blindly |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
786 pulling unknown changes into a repository is a somewhat scary |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
787 prospect. Mercurial provides the <command role="hg-cmd">hg |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
788 incoming</command> command to tell us what changes the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
789 <command role="hg-cmd">hg pull</command> command |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
790 <emphasis>would</emphasis> pull into the repository, without |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
791 actually pulling the changes in.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
792 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
793 &interaction.tour.incoming; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
794 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
795 <para id="x_5c">Bringing changes into a repository is a simple |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
796 matter of running the <command role="hg-cmd">hg pull</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
797 command, and optionally telling it which repository to pull from.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
798 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
799 &interaction.tour.pull; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
800 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
801 <para id="x_5d">As you can see from the before-and-after output |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
802 of <command role="hg-cmd">hg tip</command>, we have |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
803 successfully pulled changes into our repository. However, |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
804 Mercurial separates pulling changes in from updating the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
805 working directory. There remains one step before we will see |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
806 the changes that we just pulled appear in the working |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
807 directory.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
808 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
809 <tip> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
810 <title>Pulling specific changes</title> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
811 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
812 <para id="x_5b">It is possible that due to the delay between |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
813 running <command role="hg-cmd">hg incoming</command> and |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
814 <command role="hg-cmd">hg pull</command>, you may not see |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
815 all changesets that will be brought from the other |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
816 repository. Suppose you're pulling changes from a repository |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
817 on the network somewhere. While you are looking at the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
818 <command role="hg-cmd">hg incoming</command> output, and |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
819 before you pull those changes, someone might have committed |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
820 something in the remote repository. This means that it's |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
821 possible to pull more changes than you saw when using |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
822 <command role="hg-cmd">hg incoming</command>.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
823 |
825 | 824 <para id="x_718">If you only want to pull precisely the changes that were |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
825 listed by <command role="hg-cmd">hg incoming</command>, or |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
826 you have some other reason to pull a subset of changes, |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
827 simply identify the change that you want to pull by its |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
828 changeset ID, e.g. <command>hg pull |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
829 -r7e95bb</command>.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
830 </tip> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
831 </sect2> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
832 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
833 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
834 <title>Updating the working directory</title> |
91 | 835 |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
836 <para id="x_5e">We have so far glossed over the relationship |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
837 between a repository and its working directory. The <command |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
838 role="hg-cmd">hg pull</command> command that we ran in |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
839 <xref linkend="sec:tour:pull"/> brought changes into the |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
840 repository, but if we check, there's no sign of those changes |
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
841 in the working directory. This is because <command |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
842 role="hg-cmd">hg pull</command> does not (by default) touch |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
843 the working directory. Instead, we use the <command |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
844 role="hg-cmd">hg update</command> command to do this.</para> |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
845 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
846 &interaction.tour.update; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
847 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
848 <para id="x_5f">It might seem a bit strange that <command |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
849 role="hg-cmd">hg pull</command> doesn't update the working |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
850 directory automatically. There's actually a good reason for |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
851 this: you can use <command role="hg-cmd">hg update</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
852 to update the working directory to the state it was in at |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
853 <emphasis>any revision</emphasis> in the history of the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
854 repository. If you had the working directory updated to an |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
855 old revision&emdash;to hunt down the origin of a bug, |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
856 say&emdash;and ran a <command role="hg-cmd">hg pull</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
857 which automatically updated the working directory to a new |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
858 revision, you might not be terribly happy.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
859 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
860 <para id="x_60">Since pull-then-update is such a common sequence |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
861 of operations, Mercurial lets you combine the two by passing |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
862 the <option role="hg-opt-pull">-u</option> option to <command |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
863 role="hg-cmd">hg pull</command>.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
864 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
865 <para id="x_61">If you look back at the output of <command |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
866 role="hg-cmd">hg pull</command> in <xref |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
867 linkend="sec:tour:pull"/> when we ran it without <option |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
868 role="hg-opt-pull">-u</option>, you can see that it printed |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
869 a helpful reminder that we'd have to take an explicit step to |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
870 update the working directory.</para> |
101
321732566ac1
A few bits of terminological clarification.
Bryan O'Sullivan <bos@serpentine.com>
parents:
99
diff
changeset
|
871 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
872 <para id="x_62">To find out what revision the working directory |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
873 is at, use the <command role="hg-cmd">hg parents</command> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
874 command.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
875 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
876 &interaction.tour.parents; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
877 |
691
4ce9d0754af3
Remove the words "section", "chapter", etc from in front of xref tags.
Bryan O'Sullivan <bos@serpentine.com>
parents:
690
diff
changeset
|
878 <para id="x_63">If you look back at <xref |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
879 linkend="fig:tour-basic:history"/>, you'll see arrows |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
880 connecting each changeset. The node that the arrow leads |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
881 <emphasis>from</emphasis> in each case is a parent, and the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
882 node that the arrow leads <emphasis>to</emphasis> is its |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
883 child. The working directory has a parent in just the same |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
884 way; this is the changeset that the working directory |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
885 currently contains.</para> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
886 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
887 <para id="x_64">To update the working directory to a particular |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
888 revision, give a revision number or changeset ID to the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
889 <command role="hg-cmd">hg update</command> command.</para> |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
890 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
891 &interaction.tour.older; |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
892 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
893 <para id="x_65">If you omit an explicit revision, <command |
658
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
894 role="hg-cmd">hg update</command> will update to the tip |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
895 revision, as shown by the second call to <command |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
896 role="hg-cmd">hg update</command> in the example |
b90b024729f1
WIP DocBook snapshot that all compiles. Mirabile dictu!
Bryan O'Sullivan <bos@serpentine.com>
parents:
657
diff
changeset
|
897 above.</para> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
898 </sect2> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
899 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
900 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
901 <title>Pushing changes to another repository</title> |
92 | 902 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
903 <para id="x_66">Mercurial lets us push changes to another |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
904 repository, from the repository we're currently visiting. As |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
905 with the example of <command role="hg-cmd">hg pull</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
906 above, we'll create a temporary repository to push our changes |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
907 into.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
908 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
909 &interaction.tour.clone-push; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
910 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
911 <para id="x_67">The <command role="hg-cmd">hg outgoing</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
912 command tells us what changes would be pushed into another |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
913 repository.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
914 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
915 &interaction.tour.outgoing; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
916 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
917 <para id="x_68">And the <command role="hg-cmd">hg push</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
918 command does the actual push.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
919 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
920 &interaction.tour.push; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
921 |
714 | 922 <para id="x_69">As with <command role="hg-cmd">hg |
923 pull</command>, the <command role="hg-cmd">hg push</command> | |
924 command does not update the working directory in the | |
925 repository that it's pushing changes into. Unlike <command | |
926 role="hg-cmd">hg pull</command>, <command role="hg-cmd">hg | |
927 push</command> does not provide a <literal>-u</literal> | |
928 option that updates the other repository's working directory. | |
929 This asymmetry is deliberate: the repository we're pushing to | |
930 might be on a remote server and shared between several people. | |
931 If we were to update its working directory while someone was | |
932 working in it, their work would be disrupted.</para> | |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
933 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
934 <para id="x_6a">What happens if we try to pull or push changes |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
935 and the receiving repository already has those changes? |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
936 Nothing too exciting.</para> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
937 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
938 &interaction.tour.push.nothing; |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
939 </sect2> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
940 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
941 <sect2> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
942 <title>Default locations</title> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
943 |
825 | 944 <para id="x_719">When we clone a repository, Mercurial records the location |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
945 of the repository we cloned in the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
946 <filename>.hg/hgrc</filename> file of the new repository. If |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
947 we don't supply a location to <command>hg pull</command> from |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
948 or <command>hg push</command> to, those commands will use this |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
949 location as a default. The <command>hg incoming</command> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
950 and <command>hg outgoing</command> commands do so too.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
951 |
825 | 952 <para id="x_71a">If you open a repository's <filename>.hg/hgrc</filename> |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
953 file in a text editor, you will see contents like the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
954 following.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
955 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
956 <programlisting>[paths] |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
957 default = http://www.selenic.com/repo/hg</programlisting> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
958 |
825 | 959 <para id="x_71b">It is possible&emdash;and often useful&emdash;to have the |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
960 default location for <command>hg push</command> and |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
961 <command>hg outgoing</command> be different from those for |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
962 <command>hg pull</command> and <command>hg incoming</command>. |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
963 We can do this by adding a <literal>default-push</literal> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
964 entry to the <literal>[paths]</literal> section of the |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
965 <filename>.hg/hgrc</filename> file, as follows.</para> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
966 |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
967 <programlisting>[paths] |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
968 default = http://www.selenic.com/repo/hg |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
969 default-push = http://hg.example.com/hg</programlisting> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
970 </sect2> |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
971 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
972 <sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
973 <title>Sharing changes over a network</title> |
92 | 974 |
683
c838b3975bc6
Add IDs to paragraphs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
682
diff
changeset
|
975 <para id="x_6b">The commands we have covered in the previous few |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
976 sections are not limited to working with local repositories. |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
977 Each works in exactly the same fashion over a network |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
978 connection; simply pass in a URL instead of a local |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
979 path.</para> |
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
980 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
981 &interaction.tour.outgoing.net; |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
982 |
824
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
983 <para id="x_6c">In this example, we can see what changes we |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
984 could push to the remote repository, but the repository is |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
985 understandably not set up to let anonymous users push to |
c8d662d3cb40
Improve chapter 1 further, based on comments.
Bryan O'Sullivan <bos@serpentine.com>
parents:
775
diff
changeset
|
986 it.</para> |
657
8631da51309b
Slow progress on XML conversion
Bryan O'Sullivan <bos@serpentine.com>
parents:
652
diff
changeset
|
987 |
665
27043f385f3f
Get autogeneration of examples more or less working.
Bryan O'Sullivan <bos@serpentine.com>
parents:
658
diff
changeset
|
988 &interaction.tour.push.net; |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
989 </sect2> |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
990 </sect1> |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
991 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
992 <sect1> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
993 <title>Starting a new project</title> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
994 |
827
d2aacc06e562
Add more paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents:
826
diff
changeset
|
995 <para id="x_71c">It is just as easy to begin a new project as to work on one |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
996 that already exists. The <command>hg init</command> command |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
997 creates a new, empty Mercurial repository.</para> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
998 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
999 &interaction.ch01-new.init; |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1000 |
827
d2aacc06e562
Add more paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents:
826
diff
changeset
|
1001 <para id="x_71d">This simply creates a repository named |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1002 <filename>myproject</filename> in the current directory.</para> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1003 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1004 &interaction.ch01-new.ls; |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1005 |
827
d2aacc06e562
Add more paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents:
826
diff
changeset
|
1006 <para id="x_71e">We can tell that <filename>myproject</filename> is a |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1007 Mercurial repository, because it contains a |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1008 <filename>.hg</filename> directory.</para> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1009 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1010 &interaction.ch01-new.ls2; |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1011 |
827
d2aacc06e562
Add more paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents:
826
diff
changeset
|
1012 <para id="x_71f">If we want to add some pre-existing files to the repository, |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1013 we copy them into place, and tell Mercurial to start tracking |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1014 them using the <command>hg add</command> command.</para> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1015 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1016 &interaction.ch01-new.add; |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1017 |
827
d2aacc06e562
Add more paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents:
826
diff
changeset
|
1018 <para id="x_720">Once we are satisfied that our project looks right, we |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1019 commit our changes.</para> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1020 |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1021 &interaction.ch01-new.commit; |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1022 |
827
d2aacc06e562
Add more paragraph IDs
Bryan O'Sullivan <bos@serpentine.com>
parents:
826
diff
changeset
|
1023 <para id="x_721">It takes just a few moments to start using Mercurial on a |
826
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1024 new project, which is part of its appeal. Revision control is |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1025 now so easy to work with, we can use it on the smallest of |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1026 projects that we might not have considered with a more |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1027 complicated tool.</para> |
a17d6390a480
More fixes to chapters 1 and 2.
Bryan O'Sullivan <bos@serpentine.com>
parents:
825
diff
changeset
|
1028 </sect1> |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1029 </chapter> |
93 | 1030 |
652
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1031 <!-- |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1032 local variables: |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1033 sgml-parent-document: ("00book.xml" "book" "chapter") |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1034 end: |
863a82f13901
Basic progress on XML.
Bryan O'Sullivan <bos@serpentine.com>
parents:
650
diff
changeset
|
1035 --> |