Skip to content

Commit

Permalink
Don't allow patch reviewing and patch applying to overlap
Browse files Browse the repository at this point in the history
Otherwise we get into a mess

Signed-off-by: Neil Brown <[email protected]>
  • Loading branch information
neilbrown committed Jun 13, 2006
1 parent da2bd81 commit fb08742
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions p
Original file line number Diff line number Diff line change
Expand Up @@ -564,18 +564,29 @@ case $cmd in
review )
# there are some patches in .removed that may be included in the current source
# we try to backout each one. If it backs out successfully, we move it to
# .reviewed and conitnue, else we abort
# .reviewed and continue, else we abort
# Once this has been done often enough, 'reviewed' should be run to
# move stuff to 'included' and to revert those patches
force=
if [ " $1" = " -f" ] ; then
force=yes; shift
fi
make_diff; get_meta
if [ -s .patches/path ]
if [ -s .patches/patch ]
then
echo >&2 Patch $name already open, please deal with it; exit 1;
fi
if [ -f .patches/in-review ]
then :
else
applied=`ls .patches/applied`
if [ -n "$applied" ]
then
echo >&2 Cannot review patches while any are applied.
exit 1;
fi
> .patches/in-review
fi
if [ $# -eq 0 ]
then
echo "Pending patches are:"
Expand Down Expand Up @@ -644,6 +655,11 @@ case $cmd in
# all the currently applied patches are patches that have been
# reviewed as included.
# rip them out and stick them (reversed) into included.
if [ ! -f .patches/in-review ]
then
echo >&2 Not currently reviewing patches!
exit 1;
fi
while p open last
do
make_diff -R
Expand All @@ -653,6 +669,7 @@ case $cmd in
all_files discard_one
rm -f .patches/name .patches/status .patches/notes
done
rm .patches/in-review
;;
list )
echo "Applied patches are:"
Expand All @@ -663,6 +680,11 @@ case $cmd in
exit 0
;;
apply )
if [ -f .patches/in-review ]
then
echo >&2 Cannot apply patches while reviewing other - use p reviewed
exit 1
fi
force= append=
if [ " $1" = " -f" ]; then
force=yes; shift
Expand Down

0 comments on commit fb08742

Please sign in to comment.