File: patch.man

package info (click to toggle)
tcllib 1.20%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 68,064 kB
  • sloc: tcl: 216,842; ansic: 14,250; sh: 2,846; xml: 1,766; yacc: 1,145; pascal: 881; makefile: 107; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (63 lines) | stat: -rw-r--r-- 2,246 bytes parent folder | download | duplicates (2)
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
[vset VERSION 0.1]
[manpage_begin textutil::patch n [vset VERSION]]
[keywords {diff, unified format} {unified format diff} patch {diff -ruN} git fossil]
[moddesc   {Text and string utilities}]
[titledesc {Application of uni-diff patches to directory trees}]
[category  {Text processing}]
[require Tcl 8.2]
[require textutil::patch [opt [vset VERSION]]]
[description]

This package provides a single command which applies a patch in
[uri \
	https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html \
	{unified format}]
to a directory tree.

[list_begin definitions]

[call [cmd ::textutil::patch::apply] [arg basedirectory] \
	[arg striplevel] [arg patch] [arg reportcmd]]

Applies the [arg patch] (text of the path, not file) to the files in
the [arg basedirectory] using the specified [arg striplevel].

The result of the command is the empty string.

[para] The [arg striplevel] argument is equivalent to option
[option -p] of the [syscmd patch] command.

[para] Errors are thrown when the [arg patch] does not parse, and
nothing is done to the files in [arg basedirectory].

[para] All activities during the application of the patch, including
the inability to apply a hunk are reported through the command prefix
[arg reportcmd] instead. Files with problems are left unchanged.  Note
however that this does [strong {not prevent}] changes to files with no
problems, before and after the problematic file(s).

[para] The command prefix is called in 3 possible forms:

[list_begin definitions]

[call [cmd {{*}reportcmd}] [method apply] [arg filename]]

The caller begins operation on file [arg fname], applying all hunks
collected for said file.

[call [cmd {{*}reportcmd}] [method fail] [arg filename] [arg hunk] [arg expected] [arg seen]]

Application of hunk number [arg hunk] of file [arg filename] has failed.
The command expected to find the text [arg expected], and saw [arg seen] instead.

[call [cmd {{*}reportcmd}] [method fail-already] [arg filename] [arg hunk]]

Application of hunk number [arg hunk] of file [arg filename] has failed.
The command believes that this hunk has already been applied to the file.

[list_end]
[list_end]

[vset CATEGORY textutil]
[include ../common-text/feedback.inc]
[manpage_end]