Changeset 511
- Timestamp:
- 06/07/08 08:59:23
(7 months ago)
- Author:
- jmowery
- Message:
update to storage tests
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r510 |
r511 |
|
| 8 | 8 | - add a directory recursively |
|---|
| 9 | 9 | + as above the control files and directories for the directory exist as does a copy of each file |
|---|
| | 10 | |
|---|
| 10 | 11 | * remove |
|---|
| 11 | 12 | - remove a file |
|---|
| … | … | |
| 13 | 14 | - remove a directory (always recursive) |
|---|
| 14 | 15 | + no control files or directories (see above) exist in the directory or any of its sub-directories |
|---|
| | 16 | |
|---|
| 15 | 17 | * check-in |
|---|
| 16 | 18 | - no-op if no modified files |
|---|
| … | … | |
| 20 | 22 | - if directory is locked should raise an exception |
|---|
| 21 | 23 | + raises a RuntimeError stating that the file (or directory) is locked |
|---|
| | 24 | |
|---|
| 22 | 25 | * lock |
|---|
| 23 | 26 | - lock a file |
|---|
| | 27 | + there exists a symbolic link with the name of the file in the directory |
|---|
| | 28 | + the target of the link is a file in .__storage__/ named with the same stem |
|---|
| | 29 | + the timestamp on the storage file matches the applied date of the file |
|---|
| 24 | 30 | - lock a directory |
|---|
| | 31 | + the lock flag is set; the filesystem is unchanged |
|---|
| 25 | 32 | - lock a directory recursively |
|---|
| | 33 | + the lock flag is set on the directory |
|---|
| | 34 | + each controlled file is not a symbolic link to a versioned copy in .__storage__/ |
|---|
| | 35 | + each link's target matches the applied time of the file |
|---|
| 26 | 36 | - no-op to lock a locked file or directory |
|---|
| | 37 | + if it would be legal to lock the file (i.e. if it weren't already locked), no exception should be raised |
|---|
| 27 | 38 | - raise an exception if attempting to lock a file in a locked directory |
|---|
| | 39 | + raises a RuntimeError stating that the directory is locked |
|---|
| | 40 | |
|---|
| 28 | 41 | * unlock |
|---|
| 29 | 42 | - unlock a file |
|---|
| | 43 | + the symbolic link is replaced with a writeable copy of the file in .__storage__/ with the same stem and timestamp |
|---|
| 30 | 44 | - unlock a directory |
|---|
| | 45 | + the lock flag is unset; the filesystem is unchanged |
|---|
| 31 | 46 | - unlock a directory recursively |
|---|
| | 47 | + all of the symbolic links for controlled files are replaced as above |
|---|
| | 48 | + the lock flag on the directory is unset |
|---|
| 32 | 49 | - no-op to unlock a file or directory that is not locked |
|---|
| | 50 | + if it would be legal to lock the file (i.e. if it weren't already unlocked), no exception should be raised |
|---|
| 33 | 51 | - raise an exception if attempting to unlock a file in a locked directory |
|---|
| | 52 | + raises a RuntimeError stating that the directory is locked |
|---|
| | 53 | |
|---|
| 34 | 54 | * rollback |
|---|
| 35 | 55 | - rollback a file (default now) |
|---|
| | 56 | + its applied time matches its latest time |
|---|
| 36 | 57 | - rollback a file to previous date |
|---|
| | 58 | + if a storage copy exists with the exact date specified, the applied time will be set to that time |
|---|
| | 59 | + if no exact match exists, the newest timestamp as of the specified date will be used |
|---|
| | 60 | + if the specified date is before the initial time of the file, the applied time will be 0 |
|---|
| 37 | 61 | - rollback a directory (default now) |
|---|
| | 62 | + set the applied time for the directory to latest |
|---|
| | 63 | + for each controlled file in the directory, preform the operations above for rolling files to present |
|---|
| 38 | 64 | - rollback a directory to previous date |
|---|
| | 65 | + set the applied time for the directory to the specified date |
|---|
| | 66 | + for each controlled file in the directory, perform the operations above for rolling files to a previous date |
|---|
| 39 | 67 | - rollback a directory recursively (default now) |
|---|
| | 68 | + as with the non-recursive operation but also walking into all controlled sub-directories |
|---|
| 40 | 69 | - rollback a directory recursively to previous date |
|---|
| | 70 | + as with the non-recursive operation but also walking into all controlled sub-directories |
|---|
| | 71 | |
|---|
| 41 | 72 | * revisions |
|---|
| 42 | 73 | - list revisions of a file |
|---|
| | 74 | + list contains the timestamp of each copy of the file in .__storage__/ |
|---|
| 43 | 75 | - list revisions of a directory |
|---|
| | 76 | + list contains each unique timestamp from all controlled files in .__storage__/ |
|---|
| 44 | 77 | - list revisions of a directory recursively |
|---|
| | 78 | + lists are returned for the directory and each controlled file in the directory |
|---|
| | 79 | + also returns similar lists for each controlled sub-directory |
|---|
| 45 | 80 | - list revisions of an uncontrolled file |
|---|
| | 81 | + returned dictionary is empty |
|---|
| 46 | 82 | - list revisions of an uncontrolled directory (recursive makes no differece here) |
|---|
| | 83 | + returned dictionary is empty |
|---|
| | 84 | |
|---|
| 47 | 85 | * status |
|---|
| 48 | 86 | - list status of a file |
|---|
| | 87 | + returned list contains a string representing the status of the file's applied and modification status and relevant timestamps |
|---|
| 49 | 88 | - list status of a directory |
|---|
| | 89 | + returned list contains a string for the directory and each controlled file in it |
|---|
| 50 | 90 | - list status of a directory recursively |
|---|
| | 91 | + as with the non-recursive version except the returned list contains strings for each sub-directory and thier controlled files as well |
|---|
| 51 | 92 | - list status of an uncontrolled file |
|---|
| | 93 | + returned list contains only a single string with no timestamps |
|---|
| 52 | 94 | - list status of an uncontrolled directory (recursive makes no differece here) |
|---|
| | 95 | + returned list contains only a single string for the directory with no timestamp and no file status strings |
|---|
| | 96 | |
|---|
| 53 | 97 | * export |
|---|
| 54 | 98 | - export a directory |
|---|
| 55 | | - raise an exception if destination exists |
|---|
| 56 | | - raise an exception if source is not controlled |
|---|
| | 99 | + destination path given now contains the applied version of each controlled file in the directory |
|---|
| | 100 | + a copy of each controlled sub-directory exists under destination path with copies if its files |
|---|
| | 101 | + no control files or directories exist for any of the copied files under destination path |
|---|
| | 102 | - no-op if source is not controlled |
|---|
| | 103 | + nothing changes in destination path |
|---|
| 57 | 104 | |
|---|
| 58 | 105 | Layer Class |
|---|
| … | … | |
| 60 | 107 | * creation |
|---|
| 61 | 108 | - create with a legitimate path |
|---|
| | 109 | + data for all entries is read and initialized from disk |
|---|
| 62 | 110 | - create with a path to uncontrolled directory |
|---|
| 63 | | - raise an exception if path is not a directory |
|---|
| 64 | | - raise an exception if path does not exist |
|---|
| | 111 | + layer object is created with no entries and no storage object |
|---|
| | 112 | - raise an exception if path is not a directory or does not exist |
|---|
| | 113 | + raises a ValueError stating that the path is not a directory |
|---|
| | 114 | |
|---|
| 65 | 115 | * deletion |
|---|
| 66 | 116 | - asserts that the deleted layer is unmodified since last sync to disk |
|---|
| | 117 | + due to Python's treatment of exceptions in destructors, this assertion will only print a warning and be ignored if violated |
|---|
| | 118 | |
|---|
| 67 | 119 | * update |
|---|
| 68 | 120 | - no-op if unmodified or uncontrolled |
|---|
| | 121 | + no change in on disk or in memory entries |
|---|
| 69 | 122 | - updates on disk data with all changes made |
|---|
| 70 | 123 | + the modified flag should be cleared after all calls |
|---|
| | 124 | |
|---|
| 71 | 125 | * write |
|---|
| 72 | 126 | - no-op if uncontrolled |
|---|
| | 127 | + no change in the .__status__ file |
|---|
| 73 | 128 | - write the current status to disk |
|---|
| 74 | 129 | + the modified flag should be cleared after all calls |
|---|
| | 130 | |
|---|
| 75 | 131 | * rollback |
|---|
| 76 | 132 | - no-op if current directory is not controlled |
|---|
| | 133 | + no change in the filesystem or the layer object |
|---|
| 77 | 134 | - default: current directory, now, non-recursive |
|---|
| | 135 | + applied time for all controlled files and current directory are set to latest |
|---|
| 78 | 136 | - rollback a file to now |
|---|
| | 137 | + specified file's applied time is set to latest |
|---|
| | 138 | + no other entries are changed |
|---|
| 79 | 139 | - rollback a sub-directory to now |
|---|
| | 140 | + no entries in current layer object are changed |
|---|
| | 141 | + .__status__ file in the sub-directory has been modified |
|---|
| 80 | 142 | - rollback a sub-directory to now recursively |
|---|
| | 143 | + as with the non-recursive version but all sub-directories have modified .__status__ files |
|---|
| | 144 | - rollback a file to a previous date |
|---|
| | 145 | + the applied date is set to the most recent as of the specified date |
|---|
| | 146 | + if the specified date is before the initial time for that entry, the applied is set to 0 |
|---|
| | 147 | - rollback current directory to a previous date |
|---|
| | 148 | + the applied time for the current directory is set to the specified date |
|---|
| | 149 | + the applied time for all controlled files are set as above |
|---|
| | 150 | - rollback a sub-directory to a previous date |
|---|
| | 151 | + no change to local entries |
|---|
| | 152 | + the .__status__ file in the sub-directory is updated |
|---|
| | 153 | - rollback current directory to a previous date recursively |
|---|
| | 154 | + as per the non-recursive version and all sub-directories are also processed |
|---|
| | 155 | |
|---|
| 81 | 156 | * export |
|---|
| 82 | 157 | - no-op if current directory is not controlled |
|---|
| 83 | | - raise an exception if destination does not exist |
|---|
| | 158 | + no changes in the destination path |
|---|
| | 159 | - raise an exception if destination does not exist or is not a directory |
|---|
| | 160 | + raises a ValueError stating that the path is not a directory |
|---|
| 84 | 161 | - export current directory (recursively) to destination directory |
|---|
| | 162 | + copies of each file and sub-directory exist under destination path with no control files |
|---|
| | 163 | |
|---|
| 85 | 164 | * get_current |
|---|
| 86 | 165 | - get path of current applied version of a file |
|---|
| | 166 | + timestamp matches applied time for the file's entry |
|---|
| | 167 | + file at the returned path actually exists |
|---|
| 87 | 168 | - get empty string for a directory or uncontrolled file |
|---|
| | 169 | + empty string only returned in this case |
|---|
| | 170 | |
|---|
| 88 | 171 | * get_latest |
|---|
| 89 | 172 | - get path of latest checked-in version of a file |
|---|
| | 173 | + timestamp matches latest time for the file's entry |
|---|
| | 174 | + file at the returned path actually exists |
|---|
| 90 | 175 | - get empty string for a directory or uncontrolled file |
|---|
| | 176 | + empty string only returned in this case |
|---|
| | 177 | |
|---|
| 91 | 178 | * is_modified |
|---|
| 92 | 179 | - unconditionally false for a directory |
|---|
| | 180 | + returns False |
|---|
| 93 | 181 | - true for a file if its mtime is greater than its latest time |
|---|
| | 182 | + only true in this case |
|---|
| | 183 | |
|---|
| 94 | 184 | * checkin |
|---|
| 95 | 185 | - recursively add new version for every file modified under the current directory or any of its sub-directories |
|---|
| | 186 | + new copy of any modified file exists in .__storage__/ |
|---|
| | 187 | + the latest time for any modified file's entry is updated |
|---|
| | 188 | + the latest time for the containing directory is updated (only if at least one file changed) |
|---|
| 96 | 189 | - raise an exception if current directory is uncontrolled |
|---|
| | 190 | + raises a RuntimeError stating that files may not be checked into an uncontrolled directory |
|---|
| | 191 | |
|---|
| 97 | 192 | * add |
|---|
| 98 | 193 | - add a file |
|---|
| | 194 | + layer contains an entry for the file |
|---|
| | 195 | + a new copy exists in .__storage__/ |
|---|
| | 196 | + the latest time for the layer is updated |
|---|
| | 197 | + the latest time for the file is updated |
|---|
| 99 | 198 | - add a directory |
|---|
| | 199 | + control files are created in the directory |
|---|
| | 200 | + an entry for '.' exists |
|---|
| | 201 | + if the directory's parent is controlled, an entry for the current directory is added there |
|---|
| 100 | 202 | - add a file recursively when the current directory is uncontrolled |
|---|
| | 203 | + entry for the file exists |
|---|
| | 204 | + entry for '.' exists |
|---|
| | 205 | + control files are created in the directory |
|---|
| | 206 | + a copy of the file exists in .__storage__/ |
|---|
| 101 | 207 | - add a directory recursively |
|---|
| | 208 | + adds the directory |
|---|
| | 209 | + adds each file in the directory |
|---|
| 102 | 210 | - raise an exception if file does not exist |
|---|
| | 211 | + raises a ValueError stating the file does not exist |
|---|
| | 212 | - raise an exception if current directory is uncontrolled and recursive flag is false |
|---|
| | 213 | + raises a RuntimeError stating the above |
|---|
| 103 | 214 | - raise an exception if file is locked |
|---|
| | 215 | + raises a RuntimeError stating the file is locked and cannot be modified |
|---|
| 104 | 216 | - raise an exception if current directory is locked |
|---|
| | 217 | + raises a RuntimeError stating that the directory is locked and its files cannot be modified |
|---|
| | 218 | |
|---|
| 105 | 219 | * remove |
|---|
| 106 | 220 | - no-op if current directory is uncontrolled or file is uncontrolled |
|---|
| | 221 | + no filesystem changes |
|---|
| 107 | 222 | - remove a file |
|---|
| | 223 | + the entry for the file in the layer object is removed |
|---|
| | 224 | + all copies of the file in .__storage__/ are removed |
|---|
| | 225 | + the file itself still exists |
|---|
| 108 | 226 | - remove a directory recursively |
|---|
| | 227 | + remove all storage copies of files in the directory |
|---|
| | 228 | + remove all entries |
|---|
| | 229 | + remove control files |
|---|
| | 230 | + repeat process for all sub-directories |
|---|
| 109 | 231 | - raise an exception if file is locked |
|---|
| | 232 | + raises a RuntimeError stating the file is locked and cannot be modified |
|---|
| 110 | 233 | - raise an exception if current directory is locked |
|---|
| | 234 | + raises a RuntimeError stating that the directory is locked and its files cannot be modified |
|---|
| | 235 | |
|---|
| 111 | 236 | * control |
|---|
| 112 | 237 | - no-op if current is already controlled |
|---|
| | 238 | + no filesystem changes |
|---|
| 113 | 239 | - create all control files for current directory |
|---|
| | 240 | + all control files are created in current directory (.__status__, .__storage__/, .__nodes__/, and possibly .__logs__/ if it is the root) |
|---|
| | 241 | |
|---|
| 114 | 242 | * clean |
|---|
| | 243 | - raise an exception if the directory is not controlled |
|---|
| | 244 | + raises a RuntimeError stating that uncontrolled directories cannot be cleaned |
|---|
| 115 | 245 | - raise an exception if file is not controlled |
|---|
| | 246 | + raises a ValueError stating there is no entry for file |
|---|
| 116 | 247 | - clean a file |
|---|
| | 248 | + all storage copies of file with timestamps newer than applied are deleted |
|---|
| | 249 | + file's latest time is updated to applied |
|---|
| 117 | 250 | - clean a directory |
|---|
| | 251 | + all controlled files in the directory are cleaned |
|---|
| | 252 | + directory's latest entry is set to the newest latest entry of any file |
|---|
| 118 | 253 | - clean a directory recursively |
|---|
| | 254 | + as with the non-recursive version but also operates on sub-directories |
|---|
| 119 | 255 | - no-op if file is applied at latest time |
|---|
| | 256 | + no files are removed from .__storage__/ |
|---|
| | 257 | |
|---|
| 120 | 258 | * status_prefix |
|---|
| 121 | 259 | - return status prefix for a file |
|---|
| | 260 | + returns a 6 character string the first and last of which are space |
|---|
| | 261 | + the second is '!' if the file is not local, and space otherwise |
|---|
| | 262 | + the third is one of the following in order of precedence: |
|---|
| | 263 | ~ 'D' if its applied date is less than its initial date |
|---|
| | 264 | ~ 'M' if the file has been modified since its last addition |
|---|
| | 265 | ~ 'N' if the file's applied time is newer than its parent directory's applied time |
|---|
| | 266 | ~ 'R' if its applied time is less than its latest time |
|---|
| | 267 | ~ space in all other cases |
|---|
| | 268 | + the fourth is '.' |
|---|
| | 269 | + the fifth is '&' if the file is locked and space otherwise |
|---|
| 122 | 270 | - return status prefix for an uncontrolled file |
|---|
| | 271 | + returns exactly ' ?. ' (two spaces, '?', '.', two spaces) |
|---|
| 123 | 272 | - return status prefix for current directory |
|---|
| | 273 | + as with a controlled file except the fourth character is '-' (or '=' if current is a local customization directory) |
|---|
| 124 | 274 | - return status prefix for a sub-directory |
|---|
| | 275 | + as with a controlled file except the fourth character is '+' (or '=' as above) |
|---|
| | 276 | |
|---|
| 125 | 277 | * version_suffix |
|---|
| 126 | 278 | - return version time(s) for a controlled file or current directory |
|---|
| | 279 | + returns a string starting with '@' followed by the applied time |
|---|
| | 280 | + if the applied time is not the latest it will also contain a '/' followed by the latest time |
|---|
| | 281 | + if the applied time is 0 the first timestamp will instead be the string 'DISABLED' |
|---|
| 127 | 282 | - return empty string for an uncontrolled file or a sub-directory |
|---|
| | 283 | + returns empty string only in this case |
|---|
| | 284 | |
|---|
| 128 | 285 | * status |
|---|
| 129 | 286 | - return status for a file |
|---|
| | 287 | + return a list with one string per file of the form status_prefix, name, version_suffix |
|---|
| 130 | 288 | - return status for a directory (and its files) |
|---|
| | 289 | + return a list of status strings as above first for the directory itself then each file in it (controlled and uncontrolled) |
|---|
| 131 | 290 | - return status for a directory recursively |
|---|
| | 291 | + return a list as above for the directory then followed by each sub-directory (with its files) in order |
|---|
| 132 | 292 | - raise an exception if file does not exist |
|---|
| | 293 | + raises a RuntimeError stating that the file does not exist |
|---|
| | 294 | |
|---|
| 133 | 295 | * revisions |
|---|
| 134 | | - return empty dictionary for uncontrolled current directory or uncontrolled file |
|---|
| | 296 | - return empty dictionary for uncontrolled directory or uncontrolled file |
|---|
| | 297 | + only empty in these two conditions |
|---|
| 135 | 298 | - return dictionary with name and revisions list for a file |
|---|
| | 299 | + dictionary contains key of file name and value of a list of all revisions of that file |
|---|
| | 300 | + each revision in the list has a corresponding file in .__storage__/ |
|---|
| | 301 | + all files with the same stem in .__storage__/ have a timestamp in the returned list |
|---|
| 136 | 302 | - return dictionary with name and revisions list for each file in a directory |
|---|
| | 303 | + dictionary contains an entry for '.' with a list of all unique timestamps |
|---|
| | 304 | + also contains one entry for each controlled file as above |
|---|
| | 305 | |
|---|
| 137 | 306 | * list_controlled_files |
|---|
| 138 | 307 | - return list of files under revision control |
|---|
| | 308 | + all returned files have at least one copy in .__storage__/ |
|---|
| | 309 | + all unique file stems in .__storage__/ appear in the list |
|---|
| 139 | 310 | - return empty list if current directory is uncontrolled |
|---|
| | 311 | |
|---|
| 140 | 312 | * list_local_newer |
|---|
| 141 | 313 | - return a list of files with applied times later than the directory |
|---|
| | 314 | + only newer files appear in the list |
|---|
| | 315 | + all newer files appear in the list |
|---|
| | 316 | |
|---|
| 142 | 317 | * list_controlled_dirs |
|---|
| 143 | 318 | - return a list of controlled sub-directories |
|---|
| | 319 | + all directories with control files under the current directory appear in the list |
|---|
| | 320 | |
|---|
| 144 | 321 | * list_controlled |
|---|
| 145 | 322 | - return a list of all controlled files and directories |
|---|
| | 323 | + combined list of list_controlled_files and list_controlled_dirs |
|---|
| | 324 | |
|---|
| 146 | 325 | * lock |
|---|
| 147 | 326 | - no-op if file or directory is already locked |
|---|
| | 327 | + no filesystem changes |
|---|
| 148 | 328 | - lock a file |
|---|
| | 329 | + file is replaced by a symbolic link to the applied version in .__storage__/ |
|---|
| 149 | 330 | - lock a directory |
|---|
| | 331 | + if recursive, lock all controlled files |
|---|
| | 332 | + set the directory's lock flag |
|---|
| 150 | 333 | - raise an exception if attempting to lock a file in a locked directory |
|---|
| | 334 | + raises a RuntimeError stating that the directory is locked and its files cannot be modified |
|---|
| | 335 | |
|---|
| 151 | 336 | * unlock |
|---|
| 152 | 337 | - no-op if file or directory is not locked |
|---|
| | 338 | + no filesystem changes |
|---|
| 153 | 339 | - unlock a locked file |
|---|
| | 340 | + symbolic link is replaced by a writeable copy of its former target |
|---|
| 154 | 341 | - unlock a locked directory |
|---|
| | 342 | + unset the directory's lock flag |
|---|
| | 343 | + if recursive, unlock all controlled files |
|---|
| 155 | 344 | - raise an exception if attempting to unlock a locked file in a locked directory |
|---|
| | 345 | + raises a RuntimeError stating that the directory is locked and its files cannot be modified |
|---|
| | 346 | |
|---|
| 156 | 347 | * is_locked |
|---|
| 157 | 348 | - return true if file or directory is locked |
|---|
| | 349 | + only true in this case |
|---|
| 158 | 350 | - return true if any file under a directory is locked when called recursively |
|---|
| | 351 | + only true in this case |
|---|
| | 352 | |
|---|
| 159 | 353 | * add_node //NOTE: this is an internal function |
|---|
| 160 | 354 | - add a node |
|---|
| 161 | 355 | + adds the appropriate file (named by node IP) to a layer's .__nodes__/ directory |
|---|
| | 356 | |
|---|
| 162 | 357 | * list_nodes |
|---|
| 163 | 358 | - list nodes in a directory |
|---|
| | 359 | + all nodes listed have a corresponding file in .__nodes__/ |
|---|
| | 360 | + all nodes with a corresponding file in .__nodes__/ appear in the list |
|---|
| | 361 | |
|---|
| 164 | 362 | * get_node |
|---|
| 165 | 363 | - get a Node object for a node in the current directory |
|---|
| | 364 | + if the node exists return a node object; return None otherwise |
|---|
| | 365 | |
|---|
| 166 | 366 | * append_log_messages |
|---|
| 167 | 367 | - applied a list of messages to the log for a given node |
|---|
| | 368 | + the log file in the root directory's .__logs__/ directory will be modified |
|---|
| | 369 | + the log file's size only increases |
|---|
| | 370 | |
|---|
| 168 | 371 | * get_log_messages |
|---|
| 169 | 372 | - get a list of all messages recorded for a single node |
|---|
| | 373 | + all messages appended previously are returned |
|---|
| | 374 | |
|---|
| 170 | 375 | * clear_log |
|---|
| 171 | 376 | - clear the list of messages for a single node |
|---|
| | 377 | + the log file should be empty |
|---|
| | 378 | |
|---|
| 172 | 379 | * get_entry |
|---|
| 173 | 380 | - get the entry for a controlled file or sub-directory |
|---|
| | 381 | + returns a valid entry object |
|---|
| 174 | 382 | - return none for uncontrolled files or sub-directories |
|---|
| | 383 | + only returns None in this case |
|---|
| 175 | 384 | |
|---|
| 176 | 385 | Node Class |
|---|
| … | … | |
| 178 | 387 | * creation |
|---|
| 179 | 388 | - given an id and the root of storage, return an existing node object |
|---|
| | 389 | + object is initialized and correctly detects its classification |
|---|
| 180 | 390 | - given a new id and the root of storage, return a new unclassified node object |
|---|
| | 391 | + entries, bools, layers, and classification are all empty |
|---|
| 181 | 392 | - given a new id and the root of storage and a classification, return a new node classified as requested |
|---|
| | 393 | + node will appear in each layer in the classification's .__nodes__/ directory |
|---|
| | 394 | + entries will contain an entry for each file in those layers with a 0 applied time |
|---|
| | 395 | + layers will contain an entry for each layer in classification |
|---|
| | 396 | |
|---|
| 182 | 397 | * deletion |
|---|
| 183 | 398 | - asserts the deleted node is unmodified since last sync to disk |
|---|
| | 399 | + due to Python's treatment of exceptions in destructors, this assertion will only print a warning and be ignored if violated |
|---|
| | 400 | |
|---|
| 184 | 401 | * list_layers |
|---|
| 185 | 402 | - return an ordered list of the paths of all layers containing the node |
|---|
| | 403 | + list includes all layers in classification |
|---|
| | 404 | |
|---|
| 186 | 405 | * check_updates |
|---|
| 187 | 406 | - return a dictionary of names to be updated and the file to be sent (empty for deletion) |
|---|
| | 407 | + unless all entries applied times match the appropriate layer's entry's applied time, storage path for each file with a different applied time |
|---|
| | 408 | |
|---|
| 188 | 409 | * write |
|---|
| 189 | 410 | - write the data to disk |
|---|
| | 411 | + the appropriate files in .__nodes__/ are modified |
|---|
| | 412 | |
|---|
| 190 | 413 | * set_file_status |
|---|
| 191 | 414 | - set the status of a file sent to a node |
|---|
| | 415 | + sets the applied time for the entry to the timestamp of the sent file |
|---|
| 192 | 416 | - raise an exception if file does not exist or is uncontrolled |
|---|
| | 417 | + raises a ValueError stating that the file does not have an entry in the given layer |
|---|
| 193 | 418 | - raise an exception if attempting to add local customizations to directories other than the local customization directory for that node |
|---|
| | 419 | + raises a RuntimeError stating that local customizations can only occur in the appropriate directory |
|---|
| | 420 | |
|---|
| 194 | 421 | * set_bool_status |
|---|
| 195 | 422 | - record the state of a boolean |
|---|
| | 423 | + adds the boolean with the value recorded to bools |
|---|
| | 424 | |
|---|
| 196 | 425 | * update |
|---|
| 197 | 426 | - no-op if unmodified |
|---|
| | 427 | + no filesystem changes |
|---|
| 198 | 428 | - updates on disk data with all changes made |
|---|
| 199 | 429 | + the modified flag should be cleared after all calls |
|---|
| | 430 | |
|---|
| 200 | 431 | * classify |
|---|
| 201 | 432 | - with no argument, calculate the classification of a node |
|---|
| | 433 | + final component of classification should be the id of the node |
|---|
| | 434 | + all controlled files in each layer in classification should have an entry |
|---|
| 202 | 435 | - with a group name, reclassify the node so that the leaf in the hierarchy is under group's layer |
|---|
| | 436 | + the directory with the name matching the node id will be moved to (or created at) the leaf of the classification tree |
|---|
| | 437 | + all layers part of both the new and old classification should be unchanged |
|---|
| | 438 | + the status of local customizations should be unchanged |
|---|
| | 439 | + all entries for files not present in any layer of the new classification should be removed |
|---|
| | 440 | + entries for all files in the new layers should exist |
|---|
Download in other formats:
* Generating other formats may take time.