Mercurial Manual-Editable
Mercurial Manual-Editable
Definitive Guide
Bryan O'Sullivan
Table of Contents
Preface .................................................................................................................................................................................. xi
1. Technical storytelling........................................................................................................................................... xi
2. Thank you for supportingMercurial .................................................................................................................... xi
3. Acknowledgments ............................................................................................................................................... xi
4. Conventions Used in This Book ....................................................................................................................... xii
5. Using Code Examples ........................................................................................................................................ xii
6. Safari® Books Online ........................................................................................................................................ xii
7. How to Contact Us ............................................................................................................................................ xiii
1. How did we get here? ..................................................................................................................................................... 1
1.1. Why revision control? Why Mercurial? ............................................................................................................. 1
1.1.1. Why use revision control?...................................................................................................................... 1
1.1.2. The many names of revision control ..................................................................................................... 2
1.2. About the examples in this book........................................................................................................................ 2
1.3. Trends in the field .............................................................................................................................................. 2
1.4. A few of the advantages of distributed revision control .................................................................................... 3
1.4.1. Advantages for open source projects..................................................................................................... 3
1.4.2. Advantages for commercial projects ..................................................................................................... 4
1.5. Why choose Mercurial? ..................................................................................................................................... 4
1.6. Mercurial compared with other tools ................................................................................................................. 4
1.6.1. Subversion ............................................................................................................................................. 5
1.6.2. Git .......................................................................................................................................................... 5
1.6.3. CVS ...................................................................................................................................................... 6
1.6.4. Commercialtools.................................................................................................................................... 6
1.6.5. Choosing a revision control tool............................................................................................................ 6
1.7. Switching from another tool to Mercurial.......................................................................................................... 6
1.8. A short history of revision control ..................................................................................................................... 7
2. A tour of Mercurial: the basics....................................................................................................................................... 8
2.1. Installing Mercurial on your system .................................................................................................................. 8
2.1.1. Windows ............................................................................................................................................... 8
2.1.2. Mac OS X.............................................................................................................................................. 8
2.1.3. Linux ..................................................................................................................................................... 8
2.1.4. Solaris.................................................................................................................................................... 8
2.2. Getting started.................................................................................................................................................... 8
2.2.1. Built-in help .......................................................................................................................................... 9
2.3. Working with arepository .................................................................................................................................. 9
2.3.1. Making a local copy of a repository...................................................................................................... 9
2.3.2. What's in a repository? ........................................................................................................................ 10
2.4. A tour through history ..................................................................................................................................... 10
2.4.1. Changesets, revisions, and talking to other people ............................................................................. 11
2.4.2. Viewing specific revisions .................................................................................................................. 12
2.4.3. More detailed information................................................................................................................... 12
2.5. All about command options............................................................................................................................. 13
2.6. Making and reviewing changes ....................................................................................................................... 14
2.7. Recording changes in a new changeset ........................................................................................................... 15
2.7.1. Setting up a username ......................................................................................................................... 15
2.7.2. Writing a commit message.................................................................................................................. 16
2.7.3. Writing a good commit message......................................................................................................... 16
2.7.4. Aborting a commit .............................................................................................................................. 17
2.7.5. Admiring our new handiwork ............................................................................................................. 17
2.8. Sharing changes ............................................................................................................................................... 17
2.8.1. Pulling changes from another repository ............................................................................................ 17
2.8.2. Updating the working directory .......................................................................................................... 18
2.8.3. Pushing changes to another repository................................................................................................ 19
2.8.4. Default locations ................................................................................................................................. 20
2.8.5. Sharing changes over a network ......................................................................................................... 20
ii