summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt.changes6
-rw-r--r--quilt.quiltrc1
-rw-r--r--quilt/patches.in33
-rw-r--r--quilt/scripts/patchfns.in2
4 files changed, 34 insertions, 8 deletions
diff --git a/quilt.changes b/quilt.changes
index 4db5776..e8430e0 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Sun Mar 8 22:17:46 CET 2009 - agruen@suse.de
+
+- series and patches commands: add --color options for colorizing
+ the output.
+
+-------------------------------------------------------------------
Sun Feb 1 21:03:42 CET 2009 - agruen@suse.de
- push command: Add --fuzz=N option. Add experimental --merge
diff --git a/quilt.quiltrc b/quilt.quiltrc
index ce2a513..b815d32 100644
--- a/quilt.quiltrc
+++ b/quilt.quiltrc
@@ -16,6 +16,7 @@ QUILT_PUSH_ARGS="--color=auto"
QUILT_DIFF_ARGS="--no-timestamps --color=auto"
QUILT_REFRESH_ARGS="--no-timestamps --backup"
QUILT_SERIES_ARGS="--color=auto"
+QUILT_PATCHES_ARGS="--color=auto"
# (Add "-p ab" to QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS to get
# -p1 style diffs with a/file and b/file filenams in headers
diff --git a/quilt/patches.in b/quilt/patches.in
index 1b1662a..a392a12 100644
--- a/quilt/patches.in
+++ b/quilt/patches.in
@@ -37,15 +37,15 @@ Note that this heuristic is much slower than scanning applied patches.)
scan_applied()
{
- local prefix=$1 file=$2
- shift 2
+ local color=$1 prefix=$2 file=$3
+ shift 3
local patch
for patch in "$@"
do
if [ -f "$(backup_file_name $patch "$file")" ]
then
- echo "$prefix$(print_patch $patch)"
+ echo "$color$prefix$(print_patch $patch)$color_clear"
fi
done
}
@@ -85,7 +85,7 @@ scan_unapplied()
done
}
-options=`getopt -o vh -- "$@"`
+options=`getopt -o vh --long color:: -- "$@"`
if [ $? -ne 0 ]
then
@@ -100,6 +100,19 @@ do
-v)
opt_verbose=1
shift ;;
+ --color)
+ case "$2" in
+ "" | always)
+ opt_color=1 ;;
+ auto | tty)
+ opt_color=
+ [ -t 1 ] && opt_color=1 ;;
+ never)
+ opt_color= ;;
+ *)
+ usage ;;
+ esac
+ shift 2 ;;
-h)
usage -h ;;
--)
@@ -127,10 +140,16 @@ else
unapplied=""
fi
-scan_applied "$applied" "$opt_file" $(patches_before $top)
+[ -n "$opt_color" ] && setup_colors
+
+scan_applied "$color_series_app" "$applied" "$opt_file" \
+ $(patches_before $top)
[ -n "$top" ] && \
- scan_applied "$current" "$opt_file" $top
-scan_unapplied "$unapplied" "$opt_file" $(patches_after $top)
+ scan_applied "$color_series_top" "$current" "$opt_file" \
+ $top
+scan_unapplied "$color_series_una" "$unapplied" "$opt_file" \
+ $(patches_after $top)
+
### Local Variables:
### mode: shell-script
### End:
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 5a1a8ac..205895f 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -953,7 +953,7 @@ print_patch() {
setup_colors()
{
- local C=diff_hdr=32:diff_add=36:diff_mod=35:diff_rem=35:diff_hunk=33:diff_ctx=35:diff_cctx=33:patch_offs=33:patch_fuzz=35:patch_fail=31:patch_applied=32:series_app=32:series_top=32:series_una=:clear=00
+ local C=diff_hdr=32:diff_add=36:diff_mod=35:diff_rem=35:diff_hunk=33:diff_ctx=35:diff_cctx=33:patch_offs=33:patch_fuzz=35:patch_fail=31:patch_applied=32:series_app=32:series_top=33:series_una=00:clear=00
[ -n "$QUILT_COLORS" ] && C="$C:$QUILT_COLORS"
C=${C//=/=\'$'\e'[}