[darcs-users] Re: definition of "depends on"?
Adam Megacz
megacz at cs.berkeley.edu
Sun Apr 29 03:16:07 UTC 2007
"Jason Dagit" <dagit at codersbase.com> writes:
> I think the only precise statement is to learn about darcs patch
> theory. You can find a section on this subject in the darcs manual:
> http://www.darcs.net/manual/node8.html
Oh, thanks. I read this stuff a while back when I started using
darcs, but I forgot that it actually defined what the "context" was.
So, let's give this another try.
The theory of patches says that "when two patches fail to commute, it
is said that the second patch depends on the first". Earlier it says
that "the context of a patch consists of the set of patches that
precede it".
Using the right-to-left (group-like?) notation, if I have a repository
like this:
P_3 P_2 P_1
We would say that "P_2 is in the context of P_3, and therefore P_3
depends on P_2". However, if P_3 and P_2 commute, then I can
transform the repository to an equivalent state:
P'_2 P'_3 P_1
In which the "changes caused by" P_3 (that is, P'_3) do not contain
P_2 or P'_2 in their context. So we can say that "it is possible to
re-order the repository so that the changes embodied in P_3 do not
depend on the changes embodied in P_2".
So it would seem that commuting patches changes what they depend on.
If everything up to this point is correct, then my question is this:
if two patches commute, will darcs always be able to unpull one
without unpulling the other?
Phrased another way, "can I get darcs to use its ability to commute
patches to break dependencies?" I realize this is not always
possible, but it seems like there are situations where this *is*
possible, but darcs does not attempt to re-order the patches (or at
least I can't figure out how to ask it to do that).
One other question: is there ever a case where a patch cannot be
commuted past a pair of other patches, but the combination of the pair
does commute? In other words, is there a case where
A B C <-/-> B' A' C <-/-> B' C' A''
(where one of the two <-/->'s fails) yet
A (B C) <--> (B C)' A'
(where <--> indicates a successful commute)
Thanks,
- a
More information about the darcs-users
mailing list