~ubuntu-dev/ubuntu/lucid/quilt/lucid-201002110858

« back to all changes in this revision

Viewing changes to quilt/diff.in

  • Committer: Bazaar Package Importer
  • Author(s): Martin Quinson
  • Date: 2005-03-23 11:10:07 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050323111007-p47150ucnnuyc07p
Tags: 0.39-2
* Pass -p $opt_strip_level option to diffstat in refresh command.
  (Closes: #298785)
* fixes from upstream cvs:
  - Add a missing "exit 1" to quilt/fold.in when no patches are applied.
  - typo in graph help message
  

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        . @SCRIPTS@/patchfns
18
18
fi
19
19
 
 
20
setup_colors
 
21
 
20
22
usage()
21
23
{
22
24
        printf $"Usage: quilt diff [-p n] [-u|-U num|-c|-C num] [--combine patch|-z] [-R] [-P patch] [--snapshot] [--diff=utility] [--color] [file ...]\n"
71
73
colorize() {
72
74
        if [ -n "$opt_color" ]; then
73
75
                @AWK@ '
74
 
                function esc(x) { return "'$'\e''[" x "m" }
75
76
                { if (/^(Index:|\-\-\-|\+\+\+|\*\*\*) /)
76
 
                    print esc(32) $0 esc(0)
 
77
                    print "'$color_diff_hdr'" $0 "'$color_clear'"
77
78
                  else if (/^\+/)
78
 
                    print esc(36) $0 esc(0)
79
 
                  else if (/^(\-|!)/)
80
 
                    print esc(35) $0 esc(0)
 
79
                    print "'$color_diff_add'" $0 "'$color_clear'"
 
80
                  else if (/^-/)
 
81
                    print "'$color_diff_rem'" $0 "'$color_clear'"
 
82
                  else if (/^!/)
 
83
                    print "'$color_diff_mod'" $0 "'$color_clear'"
81
84
                  else if (/^@@ \-[0-9]+(,[0-9]+)? \+[0-9]+(,[0-9]+)? @@/)
82
85
                    print gensub(/^(@@[^@]*@@)([ \t]*)(.*)/,
83
 
                         esc(33) "\\1" esc(0) "\\2" esc(35) "\\3" esc(0), "")
 
86
                         "'$color_diff_hunk'" "\\1" "'$color_clear'" \
 
87
                         "\\2" \
 
88
                         "'$color_diff_ctx'" "\\3" "'$color_clear'", "")
84
89
                  else if (/^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/)
85
 
                    print esc(33) $0 esc(0)
 
90
                    print "'$color_diff_cctx'" $0 "'$color_clear'"
86
91
                  else
87
92
                    print
88
93
                }'