[darcs-devel] Darcs record --dont-allow-conflicts ?
Nicolas Pouillard
nicolas.pouillard at gmail.com
Fri Mar 28 14:40:09 UTC 2008
Excerpts from David Roundy's message of Fri Mar 28 15:00:49 +0100 2008:
> On Fri, Mar 28, 2008 at 02:51:28PM +0100, Nicolas Pouillard wrote:
> > I would like to have a new option for commands like darcs record, namely
> > --dont-allow-conflicts. The purpose is to help guys that try to avoid
> > conflicts in their repositories, or want to precisely know that they are
> > adding a patch resolution!
> >
> > This option will then forbid darcs to resolve a conflict, when recording a
> > patch with this option turned on.
>
> This would definitely require a better flag name, since you're not
> disallowing conflicts, you're talking about disallowing conflict
> resolutions.
You're right I was badly trying to avoid introducing new names, but there
it's really resolutions that are forbidden.
> > I'm likely to give it a try, however one or two clues for starting will be
> > welcome. In particular I would like to know if today's darcs code knows about
> > a conflict resolution when recording a change.
>
> No, darcs record knows nothing about conflicts. You'd probably have to
> look at the mark-conflicts code to get an idea as to how darcs looks for
> existing conflicts (which is considerably harder than noticing new
> conflicts).
Ok so naively something like this could works:
mypatch <- ...the patch we are about to record...
oldr <- read_repo repository
let oldres = patchset_conflict_resolutions oldr
let newr = mypatch :<: oldr
let newres = patchset_conflict_resolutions newr
let diffres = oldres \\ newres
print "Recording conflicts resolution forbidden (--dont-allow-resolutions)"
print diffres
fail
Perhaps that one can even fail earlier by just checking oldres being empty or
not, this would give an approximation.
Cheers,
--
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20080328/17097292/attachment.pgp
More information about the darcs-devel
mailing list