[darcs-users] solving #278 - unpull and pull at the same time. (was: Re: prescriptivism?)

Mark Stosberg mark at summersault.com
Sat Mar 19 13:55:21 UTC 2005

> I'm also kind of frustrated about bug #278 which I recently discovered 
> [1].  If you unpull a patch, and someone else happened to be pulling 
> that patch at that time, then that person's darcs process will exit 
> with an error message and they will see:
> Error applying patch to recorded!
> The patch was:
> {
> ...
> When I reported the bug, the initial response from the darcs 
> maintainers was "Maybe you shouldn't unpull patches if someone might be 
> pulling them from your repo at that moment.".  
> [1] http://bugs.darcs.net//Ticket/Display.html?id=278

Would could have stated more clearly is that this doesn't have to be the
permanent answer this situation. Updating the documentation is the best
answer for the moment, until a longer term solution is available. Which,
from the sound of it, could be a major piece of work to fix. 

> [*] Actually, I do have an idea for how I can avoid this situation:
> MAIN yumyum:/var/www/priv/eapa4$ function unpull {
> > DIRNAME=`basename $PWD`
> > cd ..
> > mv $DIRNAME $DIRNAME-bak
> > cd $DIRNAME-bak
> > darcs unpull ${*}
> > cd ..
> > mv $DIRNAME-bak $DIRNAME
> > cd $DIRNAME
> > }

So basically, you take the repo offline while some running 'unpull'?
That might work. A slightly fancier solution could install a placeholder
repo in the meantime, so if someone tries to pull during the unpull,
it's not as if the repo disappeared. They could get a "This repo is
temporarily unavailable message". I have no idea what's involved in
that. :) 



More information about the darcs-users mailing list