# HG changeset patch # User Dongsheng Song # Date 1237257825 -28800 # Node ID a13813534ccdb9277456958064f99e9b86ed82ac # Parent 1a3d882149fda80474ecc9f473a35887e0881e31 Fix all xref to figs diff -r 1a3d882149fd -r a13813534ccd en/ch02-tour-basic.xml --- a/en/ch02-tour-basic.xml Mon Mar 16 17:49:05 2009 +0800 +++ b/en/ch02-tour-basic.xml Tue Mar 17 10:43:45 2009 +0800 @@ -250,7 +250,8 @@ log is purely a summary; it is missing a lot of detail. - Figure provides a + Figure provides a graphical representation of the history of the hello repository, to make it a little easier to see which direction history is @@ -262,9 +263,9 @@ XXX add text - Graphical history of the hello - repository + Graphical history of + the hello repository + @@ -775,7 +776,8 @@ &interaction.tour.parents; If you look back at figure , + endterm="fig.tour-basic.history.caption" + linkend="fig.tour-basic.history"/>, you'll see arrows connecting each changeset. The node that the arrow leads from in each case is a parent, and the node that the arrow leads diff -r 1a3d882149fd -r a13813534ccd en/ch03-tour-merge.xml --- a/en/ch03-tour-merge.xml Mon Mar 16 17:49:05 2009 +0800 +++ b/en/ch03-tour-merge.xml Tue Mar 17 10:43:45 2009 +0800 @@ -37,7 +37,7 @@ We should now have two copies of hello.c with different contents. The histories of the two repositories have also diverged, as - illustrated in figure . &interaction.tour.merge.cat; @@ -46,7 +46,8 @@ XXX add text - Divergent recent histories of the Divergent recent + histories of the my-hello and my-new-hello repositories @@ -72,23 +73,24 @@ head. - XXX - add text - Repository contents after pulling from - my-hello into - my-new-hello + + + XXX add text + Repository contents after + pulling from my-hello into + my-new-hello - In figure , you can + In figure , you can see the effect of the pull from my-hello into my-new-hello. The history that was already present in my-new-hello is untouched, but a new revision has been added. By referring to figure , we can see that the changeset ID remains the same in the new repository, but the revision number has @@ -119,12 +121,11 @@ &interaction.tour.merge.merge; - - XXX - add text - Working directory and repository during - merge, and following commit + + + XXX add text + Working directory and + repository during merge, and following commit @@ -154,7 +155,7 @@ &interaction.tour.merge.tip; - In figure In figure , you can see a representation of what happens to the working directory during the merge, and how this affects the repository when the commit @@ -174,16 +175,18 @@ to decide how to reconcile the different changes into something coherent. - - - - - XXX add text - Conflicting changes to a - document + + + + + XXX add text + Conflicting + changes to a document + - Figure illustrates + Figure illustrates an instance of two conflicting changes to a document. We started with a single version of the file; then we made some changes; while someone else made different changes to the same @@ -213,7 +216,8 @@ kdiff3, which I'll use to describe the features that are common to graphical file merging tools. You can see a screenshot of kdiff3 in action in - figure . The kind of + figure . The kind of merge it is performing is called a three-way merge, because there are three different versions of the file of interest to us. The tool thus splits the upper @@ -244,12 +248,14 @@ corresponding sections of their respective files. - XXX - add text - Using kdiff3 to merge - versions of a file - + + + + XXX add text + Using + kdiff3 to merge versions of a file + + For each conflicting portion of the file, we can choose to @@ -270,7 +276,8 @@ A worked example In this example, we will reproduce the file modification - history of figure + history of figure above. Let's begin by creating a repository with a base version of our document. diff -r 1a3d882149fd -r a13813534ccd en/ch04-concepts.xml --- a/en/ch04-concepts.xml Mon Mar 16 17:49:05 2009 +0800 +++ b/en/ch04-concepts.xml Tue Mar 17 10:43:45 2009 +0800 @@ -47,15 +47,17 @@ file. The correspondence between a file in the working directory and the filelog that tracks its history in the repository is illustrated in figure . - XXX - add text - Relationships between files in working - directory and filelogs in - repository + + + XXX add text + Relationships between + files in working directory and filelogs in repository + + @@ -97,14 +99,16 @@ manifest. A revision of the manifest stores a pointer to a single revision of each filelog tracked when that changeset was created. These relationships are illustrated in figure - . + . - XXX - add textMetadata - relationships - + + + XXX add text + Metadata + relationships + As the illustration shows, there is @@ -185,11 +189,12 @@ longer it takes to reconstruct a particular revision. - XXX - add textSnapshot of - a revlog, with incremental - deltas + + + XXX add text + Snapshot of + a revlog, with incremental deltas + The innovation that Mercurial applies to this problem is @@ -201,7 +206,8 @@ quickly. This approach works so well that it has since been copied by several other revision control systems. - Figure illustrates + Figure illustrates the idea. In an entry in a revlog's index file, Mercurial stores the range of entries from the data file that it must read to reconstruct a particular revision. @@ -273,7 +279,8 @@ there is no parent here. This hash is simply a string of zeroes. - In figure , you can see + In figure , you can see an example of the conceptual structure of a revlog. Filelogs, manifests, and changelogs all have this same structure; they differ only in the kind of data stored in each delta or @@ -289,9 +296,12 @@ revision IDs in its parent slots. - XXX - add text + + + XXX add text + Revision in revlog + + @@ -338,25 +348,29 @@ changeset when you perform a commit. - XXX - add textThe working - directory can have two - parents + + + XXX add text + The working + directory can have two parents + - Figure shows the + Figure shows the normal state of the working directory, where it has a single changeset as parent. That changeset is the tip, the newest changeset in the repository that has no children. - XXX - add textThe working - directory gains new parents after a - commit + + + + XXX add text + The working + directory gains new parents after a commit + It's useful to think of the working directory as @@ -370,7 +384,8 @@ After a commit, Mercurial will update the parents of the working directory, so that the first parent is the ID of the new changeset, and the second is the null ID. This is shown - in figure . + in figure . Mercurial doesn't touch any of the files in the working directory when you commit; it just modifies the dirstate to note its new @@ -389,14 +404,17 @@ interested in, and then examine the files in the working directory directly to see their contents as they were when you committed that changeset. The effect of this is shown in - figure . + figure . - XXX - add textThe working - directory, updated to an older - changeset + + + + XXX add text + The working + directory, updated to an older changeset + Having updated the working directory to an older @@ -408,14 +426,17 @@ contains two changesets that have no children; we call these heads. You can see the structure that this creates in figure . - XXX - add textAfter a - commit made while synced to an older - changeset + + + + XXX add text + After a + commit made while synced to an older changeset + @@ -449,13 +470,17 @@ command, Mercurial leaves the first parent of the working directory unchanged, and sets the second parent to the changeset you're merging with, as shown in figure . - XXX - add textMerging two - heads + + + + XXX add text + Merging two + heads + Mercurial also has to modify the working directory, to @@ -582,8 +607,8 @@ Appending to files isn't the whole story when it comes to guaranteeing that a reader won't see a partial write. If you - recall figure , - revisions in the + recall figure , revisions in the changelog point to revisions in the manifest, and revisions in the manifest point to revisions in filelogs. This hierarchy is deliberate. diff -r 1a3d882149fd -r a13813534ccd en/ch06-collab.xml --- a/en/ch06-collab.xml Mon Mar 16 17:49:05 2009 +0800 +++ b/en/ch06-collab.xml Tue Mar 17 10:43:45 2009 +0800 @@ -271,10 +271,13 @@ isolated from developments on other branches. - XXX - add textFeature - branches + + + + XXX add text + Feature + branches + When a particular feature is deemed to be in suitable diff -r 1a3d882149fd -r a13813534ccd en/ch09-undo.xml --- a/en/ch09-undo.xml Mon Mar 16 17:49:05 2009 +0800 +++ b/en/ch09-undo.xml Tue Mar 17 10:43:45 2009 +0800 @@ -354,18 +354,21 @@ that hg backout has created is a child of the changeset we backed out. It's easier to see this in figure , which presents a graphical + endterm="fig.undo.backout.caption" linkend="fig.undo.backout"/>, + which presents a graphical view of the change history. As you can see, the history is nice and linear. - XXX - add textBacking out - a change using the hg - backout - command - + + + + XXX add text + Backing out + a change using the + hg backout + command + @@ -393,6 +396,7 @@ &interaction.backout.non-tip.cat; As the graphical history in figure illustrates, Mercurial actually commits two changes in this kind of situation (the box-shaped nodes are the ones that Mercurial @@ -407,12 +411,14 @@ second merge automatically! - XXX - add textAutomated - backout of a non-tip change using the hg backout - command + + + + XXX add text + Automated + backout of a non-tip change using the + hg backout command + The result is that you end up back where you @@ -465,6 +471,7 @@ Again, it's easier to see what has happened by looking at a graph of the revision history, in figure . This makes it clear that when we use hg backout to back out a change other than the tip, Mercurial adds a new @@ -472,13 +479,14 @@ box-shaped). - XXX - add textBacking out - a change using the hg - backout - command - + + + + XXX add text + Backing out a + change using the hg backout + command + After the hg backout @@ -509,14 +517,17 @@ Afterwards, the graphical history of our repository looks like figure - . + . - XXX - add textManually - merging a backout change - + + + + XXX add text + Manually + merging a backout change + diff -r 1a3d882149fd -r a13813534ccd en/ch12-mq.xml --- a/en/ch12-mq.xml Mon Mar 16 17:49:05 2009 +0800 +++ b/en/ch12-mq.xml Tue Mar 17 10:43:45 2009 +0800 @@ -400,15 +400,16 @@ but the patch no longer has a corresponding changeset in the repository, and the working directory does not contain the changes made by the patch. Figure illustrates + endterm="fig.mq.stack.caption" linkend="fig.mq.stack"/> illustrates the difference between applied and tracked patches. - XXX - add textApplied and - unapplied patches in the MQ patch - stack + + + XXX add text + Applied and unapplied patches + in the MQ patch stack + You can reapply an unapplied, or popped, patch using the