Skip to content

Commit

Permalink
Add recommit option to 'p'
Browse files Browse the repository at this point in the history
  • Loading branch information
neilbrown committed May 21, 2006
1 parent 7a69038 commit 991a0ca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions p
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,33 @@ case $cmd in
openall )
while p open last && p discard ; do : ; done
;;
recommit )
make_diff
get_meta
if [ -s .patches/patch ]
then
echo >&2 Patch $name already open - please commit ; exit 1;
fi
if [ $# -eq 0 ]
then
echo "Unapplied patches are:"
ls .patches/removed
exit 0
fi
if [ $# -ne 1 ]
then echo >&2 "Usage: p recommit patchname"; exit 1
fi
case $1 in
last ) pfile=`ls -d .patches/removed/[0-9]* | tail -1` ; echo last is "$pfile";;
*/* ) pfile=$1 ;;
* ) pfile=`echo .patches/removed/*$1*`
esac
if [ ! -f "$pfile" ]
then echo >&2 "Cannot find unique patch '$1' - found: $pfile"; exit 1
fi
while [ -s "$pfile" ] &&
p apply last && p commit ; do : ; done
;;
snapshot )
all_files snap_one
;;
Expand Down
8 changes: 8 additions & 0 deletions p.help
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ openall
discarded. This is part of the preparation for incorporating
upstream changes.

recommit
Usage: p recommit patchname

This command will re-apply and re-commit removed patches
that successfully apply until the names patch has been applied.
Patches are applied in reverse order, which is consistant with
the order in which they were removed.

snapshot
Usage: p snapshot

Expand Down

0 comments on commit 991a0ca

Please sign in to comment.