summaryrefslogtreecommitdiff
path: root/packages/wiggle/wiggle-0.6/003Recommit
blob: fe7dd6d7b522138a6f1d7dece28d7021ef96055c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Status: ok

New p command 'recommit'

p recommit patchname
will apply and commit a series of removed patches.

 ----------- Diffstat output ------------
 ./p      |   27 +++++++++++++++++++++++++++
 ./p.help |    8 ++++++++
 2 files changed, 35 insertions(+)

diff ./p~current~ ./p
--- ./p~current~	2004-02-03 13:01:18.000000000 +1100
+++ ./p	2004-02-03 13:18:44.000000000 +1100
@@ -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
 	;;

diff ./p.help~current~ ./p.help
--- ./p.help~current~	2004-02-03 13:01:18.000000000 +1100
+++ ./p.help	2004-02-03 13:18:44.000000000 +1100
@@ -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