Skip to content

Enforce requirement that our repos contains a subset of upstream's patches

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.

Trac metadata
Trac field Value
Version 6.10.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information