Libraries in the repo

Simon Marlow marlowsd at gmail.com
Fri Aug 28 06:42:00 EDT 2009


On 28/08/2009 10:05, Simon Marlow wrote:
> On 27/08/2009 11:37, Sittampalam, Ganesh wrote:
>> Simon Marlow wrote:
>>>>>> Simon Marlow wrote:
>>>>>>>>
>>>>>>>> I suggest if we stick with the independent repo approach that we
>>>>>>>> have some automation to check that changes are indeed getting
>>>>>>>> pushed upstream.
>> [snip unhelpful suggestion from me]
>>>
>>> Yes, it tells you that you've screwed up, rather than telling you
>>> that you're about to screw up, which would be much more convenient.
>>> After you've screwed up it might be too late to fix it, due to
>>> conflicts with upstream.
>>
>> Can you arrange that the only way that patches can get into the branch
>> is via darcs pull --intersection<upstream repo> ?
>
> That's an interesting idea, I'd forgotten about --intersection.

I have a script that works as a prehook (below).  Unfortunately it 
doesn't work on darcs.haskell.org, I think because we only have darcs 
1.0.9 there, and it is ignoring my prehook.

Can anyone think of a good reason not to upgrade darcs to 2.3.0 on 
darcs.haskell.org?  I can think of 3 reasons to do so:

  - this script, for preventing accidental divergence from upstream
  - faster pushes, due to transfer-mode
  - hide those annoying "Ignore-this: xxxxx" messages

Cheers,
	Simon

#!/bin/sh -e

# checkupstream.sh

# Only allow applying of patches that are also in this upstream repository:
UPSTREAM=$1

# echo DARCS_PATCHES_XML = $DARCS_PATCHES_XML

# Take $DARCS_PATCHES_XML and turn it into a list of patch hashes
# suitable for looping over.
hashes=`echo $DARCS_PATCHES_XML | sed 's|</patch>|</patch>\n|g' | sed -n 
'/hash/p' | sed "s|^.*hash='\([^']*\)'.*$|\1|"`

# echo hashes: $hashes

# For each patch, try pulling the patch from the upstream repo.  If
# the patch is not upstream, then fail.
for p in $hashes; do
   if darcs pull --match="hash $p" $UPSTREAM --xml --dry-run | grep "$p" 
 >/dev/null; then
       echo "Patch $p is upstream; ok"
   else
       echo "Patch $p is not upstream!"
       exit 1
   fi
done

exit 0


More information about the Glasgow-haskell-users mailing list