1SVK::XD(3) User Contributed Perl Documentation SVK::XD(3)
2
3
4
6 SVK::XD - svk depot and checkout handling.
7
9 use SVK::XD;
10 $xd = SVK::XD->new (depotmap => { '' => '/path/to/repos'});
11
13 depot
14 A repository referred by a name. The default depot is '' (the empty
15 string).
16
17 depotpath
18 A path referred by a depot name and the path inside the depot. For
19 example, //foo/bar means /foo/bar in the default depot '', and
20 /test/foo/bar means /foo/bar in the depot test.
21
22 copath
23 Checkout path. A path in the file system that has a checked out
24 version of a certain depotpath.
25
27 Options to "new":
28
29 depotmap
30 A hash reference for depot name and repository path mapping.
31
32 checkout
33 A Data::Hierarchy object for checkout paths mapping.
34
35 giantlock
36 A filename for global locking. This file protects all read and
37 write accesses to the "statefile".
38
39 When SVK begins to execute any command, it attempt to get a write
40 lock on this "giant lock" file. Once it gets the lock, it writes
41 its PID to the file, reads in its "statefile", and begins to
42 execute the command. Executing the command consists of a "lock"
43 phase and a "run" phase. During the lock phase, a command can do
44 one of three things: request to keep the giant lock for the entire
45 execution (for commands which modify large parts of the
46 "statefile"), request to lock individual checkout paths, or not
47 request a lock.
48
49 In the first case, the command sets the "hold_giant" field on the
50 SVK::Command object (this should probably change to a real API),
51 and the command does not release the giant lock until it is
52 finished; it can rewrite the "statefile" at the end of its
53 execution without waiting on the lock, since it already holds it.
54
55 In the second case, the command calls "lock" on the SVK::XD object
56 one or more times; this places a "lock" entry inside the
57 Data::Hierarchy object in the statefile next to each locked path,
58 unless they are already locked by another process. Between its
59 lock phase and its run phase, the "statefile" is written to disk
60 (with the new "lock" entries) and the giant lock is dropped. After
61 the run phase, SVK acquires the giant lock again, reads in the
62 "statefile", copies all entries from the paths that it has locked
63 into the version it just read, clears the lock entries from the
64 hierarchy, writes the "statefile" to disk, and drops the giant
65 lock. Any changes to the hierarchy other than in the locked paths
66 will be ignored.
67
68 In the third case, SVK just drops the giant lock after the lock
69 phase and never tries to read or write the "statefile" again.
70
71 statefile
72 Filename for serializing "SVK::XD" object.
73
74 svkpath
75 Directory name of "giantlock" and "statefile".
76
78 Serialization and locking
79 load
80 Load the serialized "SVK::XD" data from statefile. Initialize $self
81 if there's nothing to load. The giant lock is acquired when calling
82 "load".
83
84 store
85 store
86 Serialize $self to the statefile. If giant lock is still ours,
87 overwrite the file directly. Otherwise load the file again and
88 merge the paths we locked into the new state file. After "store" is
89 called, giant is unlocked.
90
91 lock
92 Lock the given checkout path, store the state with the lock info to
93 prevent other instances from modifying locked paths.
94
95 unlock
96 Unlock all the checkout paths that were locked by this instance.
97
98 giant_lock
99 Lock the statefile globally. All other instances need to wait for
100 the lock before they can do anything.
101
102 giant_unlock
103 Release the giant lock.
104
105 Depot and path translation
106 find_repos
107 Given depotpath and an option about if the repository should be
108 opened. Returns an array of repository path, the path inside
109 repository, and the "SVN::Repos" object if caller wants the
110 repository to be opened.
111
112 find_repos_from_co
113 Given the checkout path and an option about if the repository
114 should be opened. Returns an array of repository path, the path
115 inside repository, the absolute checkout path, the checkout info,
116 and the "SVN::Repos" object if caller wants the repository to be
117 opened.
118
119 find_repos_from_co_maybe
120 Like "find_repos_from_co", but falls back to see if the given path
121 is a depotpath. In that case, the checkout paths returned will be
122 undef.
123
124 find_depotname
125
126 create_path_object
127 Creates and returns a new path object. It can be either
128 SVK::Path::Checkout, SVK::Path::View or SVK::Path.
129
130 Takes a hash with arguments.
131
132 If "copath_anchor" argument is defined then SVK::Path::Checkout is
133 created and other arguments are used to build its "source" in
134 SVK::Path::Checkout using this method. If "revision" argument is not
135 defined then the one checkout path is based on is used.
136
137 If "view" argument is defined then SVK::Path::View is created and other
138 arguments are used to build its "source" in SVK::Path::Checkout using
139 this method.
140
141 Otherwise SVK::Path is created.
142
143 Depot can be passed as SVK::Depot object in "depot" argument or using
144 "depotname", "repospath" and "repos" arguments. Object takes
145 precendence.
146
147 Checkout handling
148 auto_prop
149 Return a hash of properties that should attach to the file
150 automatically when added.
151
152 depot_delta
153 Generate "SVN::Delta::Editor" calls to represent the changes
154 between "(oldroot, oldpath)" and "(newroot, newpath)". oldpath is a
155 array ref for anchor and target, newpath is just a string.
156
157 Options:
158
159 editor
160 The editor receiving delta calls.
161
162 no_textdelta
163 Don't generate text deltas in "apply_textdelta" calls.
164
165 no_recurse
166 notice_ancestry
167 checkout_delta
168 Generate "SVN::Delta::Editor" calls to represent the local changes
169 made to the checked out revision.
170
171 Options:
172
173 delete_verbose
174 Generate delete_entry calls for sub-entries within deleted
175 entry.
176
177 absent_verbose
178 Generate absent_* calls for sub-entries within absent entry.
179
180 unknown_verbose
181 generate cb_unknown calls for sub-entries within absent entry.
182
183 absent_ignore
184 Don't generate absent_* calls.
185
186 expand_copy
187 Mimic the behavior like SVN::Repos::dir_delta, lose copy
188 information and treat all copied descendents as added too.
189
190 cb_ignored
191 Called for ignored items if defined.
192
193 cb_unchanged
194 Called for unchanged files if defined.
195
196 get_entry($copath)
197 Returns the Data::Hierarchy entry and the schedule of the entry.
198
199 get_fh
200 Returns a file handle with keyword translation and line-ending
201 layers attached.
202
203 get_props
204 Returns the properties associated with a node. Properties schedule
205 for commit are merged if $copath is given.
206
207
208
209perl v5.32.0 2020-07-28 SVK::XD(3)