[darcs-users] Small suggestion: lock/unlock and minor idiot-proofing

Jamie Webb j at jmawebb.cjb.net
Tue Nov 23 19:54:50 UTC 2004


On Tue, Nov 23, 2004 at 01:31:47AM -0500, James Bruce wrote:
> since "darcs unrecord" is dangerous for possibly public changes, how 
> about adding a "darcs lock" command that makes a lockfile, so that you 
> can't pull from that repository (or maybe requiring --force to be 
> specified).  Then you don't need to worry about record/unrecord/rerecord 
> while it is locked.  When you are done, just "darcs unlock" and people 
> can start pulling from you.  It also should not allow "darcs push" so 
> newbies like me don't accidentally share something.  This seems quite 
> easy to implement by simply creating a _darcs/lock file, and having 
> pulls etc check for that file first.

It appears to be good practice in Darcs to maintain separate 'archive'
and 'scratch' repos, where all development is done in the scratch repo
and then pushed to the archive. There are several reasons given for
this, but the applicable one in this case is that you can keep the
scratch repo private and only push patches to the archive when you
want to publish them. Consequently, you should never unrecord from the
archive, but may always unrecord patches in your scratch repo if you
have not yet pushed them anywhere.

I think this setup offers the same safety as locking the repository,
but additionally ensures that your previously published patches remain
accessible, and doesn't require you to remember to lock the repository
before recording.

-- Jamie Webb




More information about the darcs-users mailing list