On Mon, Nov 10, 2008 at 1:13 PM, Miklos Vajna <[EMAIL PROTECTED]> wrote: > On Mon, Nov 10, 2008 at 04:18:39AM -0800, Jason Dagit <[EMAIL PROTECTED]> > wrote: >> If I understand your script correctly it constructs the patch bundle >> itself from the patches in the repository. If you don't send the >> patch that is on the top, eg., darcs changes --last=1, then I think >> maybe you are taking a serious risk of corrupting your repositories. > > Actually I'm taking the patch ids from the output of darcs changes > --xml, so probably the result will be fine.
To safely apply a patch in a repository you need more than just the patch. You also need to know that the patch is in the correct 'context'. I don't know if darcs apply is clever enough to take a patch plus a context and put the patch in the correct context. I suspect that it isn't. My reasoning is that the way you want to use darcs probably isn't one that the implementors of apply had considered. I could be wrong since I haven't checked the code. Or maybe as you say taking the hash from changes ensures things are in the right order. This would be a nice place for David comment. > Actually here is what I get: > > $ darcs show repo > Type: darcs > Format: hashed, darcs-2 > Root: /home/vmiklos/darcs/t/test2 > Pristine: HashedPristine > Cache: thisrepo:/home/vmiklos/darcs/t/test2 > Default Remote: /home/vmiklos/darcs/t/test2.darcs > Num Patches: 12 > > So I have 12 patches in this repo. Sounds good. > > $ dr send -o - --matches="hash > 20081028223344-3b154-a4c92e0d199bfd3015a59efd5bb1b7700caec0f1.gz" > --no-deps ../test2.darcs > Creating patch to "/home/vmiklos/darcs/t/test2.darcs"... > You don't want to send any patches, and that's fine with me! In general you may need to specify which repo to send to, but I don't think that's biting you here. > OK, so let's check if we have such an ID: > > $ darcs changes --xml |grep -c > 20081028223344-3b154-a4c92e0d199bfd3015a59efd5bb1b7700caec0f1.gz > 1 > > Hmm, let's see if it's already pushed: > > $ cd ../test2.darcs > $ darcs show repo > Type: darcs > Format: hashed, darcs-2 > Root: /home/vmiklos/darcs/t/test2.darcs > Pristine: HashedPristine > Cache: > thisrepo:/home/vmiklos/darcs/t/test2.darcs > Num Patches: 0 > > So it seems --no-deps is not about "don't automatically fulfill > dependencies" (according to the doc), but about "if you select foo and > it depends on bar, then don't include foo, either". Is this on purpose, > or should I report it as a bug? The latter behaviour sounds like darcs to me. So, if there is a bug it's one of the following: 1) The current UI is "correct" but has unexpected behaviour; 2) The manual needs to clarify. The idea is that if you want a patch and applying it to the target repo requires some other patch (the dependency) then darcs doesn't want to give you the patch without its dependencies. That's because without the dependency you can't safely apply the patch. This is actually another case where scripts that strip out patches and send them by themselves would be buggy. On second read, I think the quoted bit from the manual is well intentioned it's just not clear. As in one interpretaton of not automatically fulfilling dependencies is that it doesn't generate the bundle because it didn't workout the deps? Clearly this is ambiguous and should be updated. I hope that help! Jason _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
