- From: Richard Cyganiak <richard@cyganiak.de>
- Date: Mon, 29 Aug 2011 19:55:39 +0100
- To: Ivan Herman <ivan@w3.org>
Hi Ivan, On 29 Aug 2011, at 19:24, Ivan Herman wrote: > I still tryto understand some intricacies of mercurial. So what are exactly the steps you had to take to produce the URI for the FPWD? I guess it has something to do with branches, but I am not sure? I would have thought that a branch is of interest for the full of depositorz, so wouldn't that affect, say, the rdf json part of the whole depository? The standard branch is called “default”. This is on the default branch: http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-concepts/index.html I created a new branch called “rdf-concepts-FPWD”. This is on that branch: http://dvcs.w3.org/hg/rdf/raw-file/rdf-concepts-FPWD/rdf-concepts/Overview.html You are right, a branch creates a copy of the entire repository. So, the rdf-concepts-FPWD branch also has a copy of Turtle: http://dvcs.w3.org/hg/rdf/raw-file/rdf-concepts-FPWD/rdf-turtle/index.html But I created that branch only for the purpose of preparing the HTML for the RDF Concepts document, so it doesn't really matter what else is on the branch. I intend to “close” the branch as soon as the FPWD is published, so that it doesn't clutter up the list of branches. For the second working draft, I'm planning to create a new branch. Other editors could create their own branches as well for each publication – that's one way of doing it at least. Here are some helpful commands: List all open branches: $ hg branches Show the branch that's checked out in your working copy: $ hg branch Switch your working copy to another branch: $ hg up -r rdf-concepts-FPWD Subsequent commits on that working copy will go into that branch. Switch back to the default branch: $ hg up -r default Create a new branch: $ hg branch rdf-concepts-FPWD Close a branch: (I'd have to google that) Merge another branch into your working copy: (I'd have to google that. We may never need that, since changes on the branch should only be the things we do to prepare for publication, like updating SOTD and dates, and these changes shouldn't go into the default branch.) Conceptually, a repository without branches is a linked list of revisions. Each revision has a parent. The latest one is the “head”, a named head called “default” to be precise. Committing creates a new revision whose parent is the head, and then moves the head to that new revision. Branching is the act of creating a new revision *without* moving the head. This creates a new named head, whose name is the branch name, and whose parent is whatever revision you had in your working copy. This means a revision can have multiple children, and there can be multiple heads (one for each open branch). Merging is the act of creating a new revision with *two* parents, combining all the changes that were made since they diverged. Closing a branch is the act of dropping a head. So really, a repository is not a linked list, but a directed acyclic graph where each revision can have multiple children (branching) and multiple parents (merging). This should probably go on the wiki somewhere … Best, Richard
Received on Tuesday, 30 August 2011 07:43:50 UTC