id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
3646	Enforce requirement that our repos contains a subset of upstream's patches	igloo		"Simon Marlow wrote this prehook script:
{{{
#!/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
}}}
although this is not ideal, as what we really want is to abort the entire `darcs-all push`, not just the push to that repo. e.g. if you haven't pushed to the upstream Cabal repo yet, then you shouldn't push the accompanying patches to the ghc repo.
"	task	new	lowest	7.6.2	Compiler	6.10.4				Unknown/Multiple	Unknown/Multiple		Unknown				
