<div>Spontaneous branches are one of my favorite Darcs features: flyweight branching, if you will.  Of course, Darcs also supports heavyweight branching by creating a new repository with "darcs get".  I've often wanted middleweight branching or "cheap in-repo local branches" (as issue555 calls them).  This has been a request since 2007.</div>
<div><br></div><div>I've hacked together a quick and dirty prototype to get a feel for the UX.  I'll attach the script to issue555 shortly for anyone that wants to try at home.  Here's a walkthrough of how it behaves.  The goal of the walkthrough is to make a local repository with branches for Darcs' reviewed and screened repos and a third branch for my personal patches.</div>
<div><br></div><div>$ darcs get --lazy <a href="http://darcs.net/reviewed">http://darcs.net/reviewed</a> darcs</div><div>...</div><div>$ cd darcs</div><div>$ darcs-branch  # w/o arguments, lists current branches</div><div>
* master</div><div>$ darcs-branch reviewed  # declares that I want to be on a branch named reviewed. creates one if needed</div><div>$ darcs-branch delete-me # junk branch for later</div><div>$ darcs-branch screened</div>
<div>$ darcs-branch</div><div>  delete-me</div><div>  master</div><div>  reviewed</div><div>* screened</div><div>$ darcs pull -a <a href="http://darcs.net/screened">http://darcs.net/screened</a>  # pull screened patches into my screened branch</div>
<div>...</div><div>$ darcs-branch master</div><div>$ darcs pull -a <a href="http://darcs.net/screened">http://darcs.net/screened</a> # I want screened patches in my personal branch too</div><div>...</div><div>$ darcs-branch</div>
<div>  delete-me</div><div>* master</div><div>  reviewed</div><div>  screened</div><div>$ echo my change nobody else wants > foo</div><div>$ darcs record -alm 'sample change'</div><div>Finished recording patch 'sample change'</div>
<div>$ darcs changes -p 'sample change'</div><div>Fri Mar 30 15:28:18 MDT 2012  Michael Hendricks <<a href="mailto:michael@ndrix.org">michael@ndrix.org</a>></div><div>  * sample change</div><div>$ darcs-branch reviewed  # switches to the branch I created earlier</div>
<div>$ darcs changes -p 'sample change'  # finds no patch. it's not in this branch</div><div>$ darcs-branch --remove delete-me</div><div>$ darcs-branch</div><div>  master</div><div>* reviewed</div><div>  screened</div>
<div><br></div><div>It could use lots of polish, but how do others feel about the declarative UI?</div><div><br></div><div>-- </div>Michael<br>