<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 17 September 2014 02:25, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Wed, Sep 17, 2014 at 2:08 AM, Robert Kern <<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>> wrote:<br>
> Yes, but this is due to different design decisions of git and Mercurial. git<br>
> prioritized the multiple branches in a single clone use case; Mercurial<br>
> prioritized re-cloning. It's natural to do this kind of branching in git,<br>
> and more natural to re-clone in Mercurial.<br></span></blockquote><div><br></div><div>I disagree that it's more natural to re-clone in Mercurial. It's just that the preferred workflow of the Mercurial developers is to use clones, anonymous branches and bookmarks (almost the same as git branches) rather than named branches - and so that is the workflow that is most associated with using Mercurial.</div><div><br></div><div>Mercurial fully supports multiple lines of development by:</div><div><br></div><div>1. cloning;</div><div><br></div><div>2. anonymous branching (i.e. multiple heads on the same branch) - normally combined with bookmarks;</div><div><br></div><div>3. named branching (the branch name is an integral part of the commit);</div><div><br></div><div>4. all of the above combined.</div><div><br></div><div>Eventually if you want to merge between lines of development then you end up with multiple branches (either anonymous or named) in the one repo.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
</span>Ah, I wasn't aware of that philosophical difference. Does hg use<br>
hardlinks or something to minimize disk usage when you clone, or does<br>
it actually copy everything? (Or worse, does it make the new directory<br>
actually depend on the old one?)<br></blockquote><div><br></div><div>If you clone a repo to the same filesystem (e.g. the same disk partition) then Mercurial will use hardlinks for the repository files (i.e. things in .hg). This means that clones are quick (although if you don't prevent updating the working directory while cloning that can take some time ...).</div><div><br></div><div>Hardlinks may be broken any time changesets are added to the repo e.g. via a commit or pull. Only the hardlinks involved in the commit (and the manifest) will be broken.</div><div><br></div><div>Mercurial provides a standard extension (relink) to re-establish hardlinks between identical storage files. For example, running hg relink in my current feature branch repo:</div><div><br></div><div><div>[feature_branch_repo:65179] [feature_branch]> hg relink default</div><div>relinking d:\home\repos\feature_branch_repo\.hg/store to d:\home\repos\default_repo\.hg/store</div><div>tip has 22680 files, estimated total number of files: 34020</div><div>collected 229184 candidate storage files</div><div>pruned down to 49838 probably relinkable files</div><div>relinked 359 files (221 MB reclaimed)</div></div><div><br></div><div>Tim Delaney </div></div></div></div>