1SVN::Look(3) User Contributed Perl Documentation SVN::Look(3)
2
3
4
6 SVN::Look - A caching wrapper around the svnlook command.
7
9 version 0.41
10
12 use SVN::Look;
13 my $revlook = SVN::Look->new('/repo/path', -r => 123);
14 my $author = $revlook->author();
15 my $msg = $revlook->log_msg();
16 my @added_files = $revlook->added();
17 my @updated_files = $revlook->updated();
18 my @deleted_files = $revlook->deleted();
19 my @changed_files = $revlook->changed();
20 my $file_contents = $revlook->cat('/path/to/file/in/repository');
21
22 my $trxlook = SVN::Look->new('/repo/path', -t => 123);
23
25 The svnlook command is the workhorse of Subversion hook scripts, being
26 used to gather all sorts of information about a repository, its
27 revisions, and its transactions. This module provides a simple object
28 oriented interface to a specific svnlook invocation, to make it easier
29 to hook writers to get and use the information they need. Moreover, all
30 the information gathered by calling the svnlook command is cached in
31 the object, avoiding repetitious calls.
32
34 new REPO [, WHAT, NUMBER]
35 The SVN::Look constructor needs one or three arguments:
36
37 REPO is the path to the repository.
38 WHAT must be either '-r' or '-t', specifying if the third argument is a
39 revision number or a transaction number, respectively. If neither -r or
40 -t is specified, the HEAD revision is used.
41 NUMBER is either a revision or transaction NUMBER, as specified by
42 WHAT.
43
44 repo
45 Returns the repository path that was passed to the constructor.
46
47 txn
48 Returns the transaction number that was passed to the constructor. If
49 none was passed, returns undef.
50
51 rev
52 Returns the revision number that was passed to the constructor. If none
53 was passed, returns undef.
54
55 author
56 Returns the author of the revision/transaction.
57
58 cat PATH
59 Returns the contents of the file at PATH. In scalar context, return the
60 whole contents in a single string. In list context returns a list of
61 chomped lines.
62
63 changed_hash
64 Returns a reference to a hash containing information about all file
65 changes occurred in the revision. The hash always has the following
66 keys:
67
68 added
69 A list of files added in the revision.
70
71 deleted
72 A list of files deleted in the revision.
73
74 updated
75 A list of files updated in the revision.
76
77 prop_modified
78 A list of files that had properties modified in the revision.
79
80 copied
81 A hash containing information about each file or diretory copied in
82 the revision. The hash keys are the names of elements copied to.
83 The value associated with a key is a two-element array containing
84 the name of the element copied from and the specific revision from
85 which it was copied.
86
87 added
88 Returns the list of files added in the revision/transaction.
89
90 updated
91 Returns the list of files updated in the revision/transaction.
92
93 deleted
94 Returns the list of files deleted in the revision/transaction.
95
96 prop_modified
97 Returns the list of files that had properties modified in the
98 revision/transaction.
99
100 changed
101 Returns the list of all files added, updated, deleted, and the ones
102 that had properties modified in the revision/transaction.
103
104 copied_to
105 Returns the list of new names of files that were copied in the
106 revision/transaction.
107
108 copied_from
109 Returns the list of original names of files that were copied in the
110 revision/transaction. The order of this list is guaranteed to agree
111 with the order generated by the method copied_to.
112
113 date
114 Returns the date of the revision/transaction.
115
116 diff [OPTS, ...]
117 Returns the GNU-style diffs of changed files and properties. There are
118 three optional options that can be passed as strings:
119
120 "--no-diff-deleted"
121 Do not print differences for deleted files
122
123 "--no-diff-added"
124 Do not print differences for added files.
125
126 "--diff-copy-from"
127 Print differences against the copy source.
128
129 In scalar context, return the whole diff in a single string. In list
130 context returns a list of chomped lines.
131
132 dirs_changed
133 Returns the list of directories changed in the revision/transaction.
134
135 filesize PATH
136 Returns the size (in bytes) of the file located at PATH as it is
137 represented in the repository.
138
139 info
140 Returns the author, datestamp, log message size, and log message of the
141 revision/transaction.
142
143 lock PATH
144 If PATH has a lock, returns a hash containing information about the
145 lock, with the following keys:
146
147 UUID Token
148 A string with the opaque lock token.
149
150 Owner
151 The name of the user that has the lock.
152
153 Created
154 The time at which the lock was created, in a format like this:
155 '2010-02-16 17:23:08 -0200 (Tue, 16 Feb 2010)'.
156
157 Comment
158 The lock comment.
159
160 If PATH has no lock, returns undef.
161
162 log_msg
163 Returns the log message of the revision/transaction.
164
165 propget PROPNAME PATH
166 Returns the value of PROPNAME in PATH.
167
168 proplist PATH
169 Returns a reference to a hash containing the properties associated with
170 PATH.
171
172 tree [PATH_IN_REPOS, OPTS, ...]
173 Returns the repository tree as a list of paths, starting at
174 PATH_IN_REPOS (if supplied, at the root of the tree otherwise),
175 optionally showing node revision ids.
176
177 "--full-paths"
178 show full paths instead of indenting them.
179
180 "--show-ids"
181 Returns the node revision ids for each path.
182
183 "--non-recursive"
184 Operate on single directory only.
185
186 uuid
187 Returns the repository's UUID.
188
189 youngest
190 Returns the repository's youngest revision number.
191
193 Gustavo L. de M. Chaves <gnustavo@cpan.org>
194
196 This software is copyright (c) 2014 by CPqD.
197
198 This is free software; you can redistribute it and/or modify it under
199 the same terms as the Perl 5 programming language system itself.
200
201
202
203perl v5.28.0 2014-06-14 SVN::Look(3)