[darcs-users] Small suggestion: lock/unlock and minor idiot-proofing
conradme at email.uc.edu
Tue Nov 23 12:35:40 UTC 2004
On Tuesday, November 23, 2004 1:31 AM, 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.
Not sure, but you might have missed an important point about darcs
operation- when pulling or pushing, the only thing that will be looked at is
the list of recorded patches. You can in fact pull/push from a repo in
which the working copy has been /deleted/. (although pull/push *into* such
a repo would be bad)
So, if you have unrecorded changes (via 'unrecord' or not) nobody will be
able to see them until your record. The only 'dangerous' thing in regard to
other people pulling from you is if you record changes, someone pulls, and
then you ammend-record (which creates a new patch which is incompatible with
A locking mechanism would only catch that situation if your repo were locked
by default.. which isn't a vary useful thing.
Rather than following this train of thought, check out the current
conversation on "incoherent patches". The idea is about having patches
which are marked as being incompatible with eachother, such that one must be
unapplied before the other can be applied.
> Also there's this rule:
> > Rule number one of working with darcs: never do anything interesting
> > when "darcs what" doesn't say ``no changes''.
> Why not just have those commands say "you have local changes, commit
> them, or if you really know what you are doing, rerun with --force".
In theory, it should be fine to do this. In reality, we have a performance
problem with conflicts, thus the warning.
Also, this mostly applies to "unrecord" and friends, since wierd things
start happening like applying inverse patches to "go back" to previous
versions of the repo; this has a high probability of conflicting with
unrecorded changes. But, Those are kind of advanced features anyway.
Though having darcs emit a warning message about unrecorded changes might
not be bad.
More information about the darcs-users