Module SubLua
Lua binding to SubCpp - a C++ Subversion library.
Author:
Ryan P. |
Release: 1.00 <04/21/2010>
Functions
SubLua.ReleaseWorkingCopyLock () | Release the lock on the working copy Does nothing and is unnecessary in svn versions 1.6 and below |
SubLua:Add (path, options) | Schedule a working copy path for addition to the repository. |
SubLua:Cat (path, options) | Output the content of specified files or URLs. |
SubLua:Checkout (url, path, options) | Checks out a working copy from a url to a path. |
SubLua:Cleanup (path) | Recursively cleans up a local directory, finishing any incomplete operations, removing lockfiles, etc. |
SubLua:Commit (path, message, options) | Commit files or directories into repository |
SubLua:Copy (srcPath, srcRevision, destPath) | Copies one path to another |
SubLua:Delete (path, options) | Remove files and directories from version control. |
SubLua:Diff (tmpPath, path, revision1, revision2, options) | Display the differences between two revisions or paths. |
SubLua:Export (srcPath, destPath, options) | Create an unversioned copy of a tree. |
SubLua:Get (path, destPath, options) | Retrieves the contents for a specific revision of a path and saves it to the destination file dstPath. |
SubLua:Import (path, url, message, options) | Commit an unversioned file or tree into the repository. |
SubLua:Info (path, infoReceiverCallback, options) | Return information about pathOrUrl |
SubLua:Lock (path, options) | Locks files and directories. |
SubLua:MkDir (path, message) | Create a new directory under version control. |
SubLua:PropGet (propertyName, path, options) | Gets the value of a property on files, dirs, or revisions. |
SubLua:PropSet (propName, propValue, path, options) | |
SubLua:Revert (path, options) | Revert files and directories from version control. |
SubLua:Unlock (path, options) | Unlocks files and directories. |
SubLua:Update (path, options) | Updates the file or directory. |
Tables
Enums | The Subverison enums. |
Options | The Options class. |
SvnInfo | The SvnInfo class. |
Functions
- SubLua.ReleaseWorkingCopyLock ()
- Release the lock on the working copy Does nothing and is unnecessary in svn versions 1.6 and below
- SubLua:Add (path, options)
-
Schedule a working copy path for addition to the repository. Adds a file to the repository.
Parameters
- path: {string} The path to add to the working copy. Path's parent must be under revision control already.
- options: {table} [OPT] Options table. Possible Options: depth, force, no_ignore, add_parents
See also:
- SubLua:Cat (path, options)
-
Output the content of specified files or URLs.
Parameters
- path: {string} The path or URL to output.
- options: {table} [OPT] Options table. Possible Options: peg, revision
Return value:
{string} String of the contents of `@path`. - SubLua:Checkout (url, path, options)
-
Checks out a working copy from a url to a path.
Parameters
- url: {string} The URL to check out.
- path: {string} The local path to check out to.
- options: {table} [OPT] Options table. Possible Options: peg, revision, depth, ignore_externals, force
Return value:
Revision of the checkout.See also:
- SubLua:Cleanup (path)
-
Recursively cleans up a local directory, finishing any incomplete operations, removing lockfiles, etc.
Parameters
- path: {string} Path to a local directory.
- SubLua:Commit (path, message, options)
-
Commit files or directories into repository
Parameters
- path: {string}/{table} The path(s) to commit.
- message: {string} The commit message.
- options: {table} [OPT] Options table. Possible Options: depth, keep_locks, keep_changelists
See also:
- SubLua:Copy (srcPath, srcRevision, destPath)
-
Copies one path to another
Parameters
- srcPath: {string} The source path to copy from.
- srcRevision: {string} The source revision to copy from.
- destPath: {string} The destination path to copy to.
- SubLua:Delete (path, options)
-
Remove files and directories from version control.
Parameters
- path: {string}/{table} The path(s) or URL(s) to remove. If it is a local path(s) then the paths are scheduled for deletion upon the next commit. If it is a URL(s) then they are deleted immediatly.
- options: {table} [OPT] Options table. Possible Options: force, keep_local
See also:
- SubLua:Diff (tmpPath, path, revision1, revision2, options)
-
Display the differences between two revisions or paths.
Parameters
- tmpPath: {string} The first path to diff.
- path: {string} The second path to diff.
- revision1: {string}/{number} [OPT] The revision of the first file to diff.
- revision2: {string}/{number} [OPT] The revision of the second file to diff.
- options: {table} [OPT] Options table. Possible Options: depth, notice_ancestry, no_diff_deleted
See also:
- SubLua:Export (srcPath, destPath, options)
-
Create an unversioned copy of a tree.
Parameters
- srcPath: {string} The source path or URL to export from.
- destPath: {string} The destination path to export to.
- options: {table} [OPT] Options table. Possible Options: peg, revision, force, ignore_externals, depth, native_eol
Return value:
Revision of the Export.See also:
- SubLua:Get (path, destPath, options)
-
Retrieves the contents for a specific revision of a path and saves it to the destination file dstPath. If
is empty (""), then this path will be constructed from the temporary directory on this system and the filename in . will still have the file extension from and uniqueness of the temporary filename will be ensured. Parameters
- path: {string} path or url
- destPath: {string} destination path
- options: {table} [OPT] Options table. Possible Options: peg, revision
Return value:
{string} the destPath or the temp file path ifwas an empty string See also:
- SubLua:Import (path, url, message, options)
-
Commit an unversioned file or tree into the repository. Parent directories are created as necessary in the repository.
Parameters
- path: {string} The path to add to the working copy. Path's parent must be under revision control already.
- url: {string} The URL to check out.
- message: {string} [OPT] The commit message.
- options: {table} [OPT] Options table. Possible Options: depth, no_ignore, auto_props
See also:
- SubLua:Info (path, infoReceiverCallback, options)
-
Return information about pathOrUrl
Parameters
- path: {string}/{table} The path or URL to get the specified information from.
-
infoReceiverCallback: {function} [OPT] Called everytime a file is found during receiving information. For each invocation it passes path with the information present in info. Return true from the InfoReceiver() to have the function contiue, if you return false it will stop the operation and throw an error.
The prototype for the callback is
function SubLua:MyInfoReceiver( path, info )
        print( path, info )
        return true
end - options: {table} [OPT] Options table. Possible Options: peg, revision, depth
See also:
- SubLua:Lock (path, options)
-
Locks files and directories.
Parameters
- path: {string}/{table} The path(s) or URL(s) to revert.
- options: {table} [OPT] Options table. Possible Options: force
See also:
- SubLua:MkDir (path, message)
-
Create a new directory under version control.
Parameters
- path: {string}/{table} The path(s) or URL(s) to output. If it is a local path then the directory is created and scheduled for addition upon the next commit. If it is a URL then the commit is immediate.
- message: {string} [OPT] Log message as a string.
- SubLua:PropGet (propertyName, path, options)
-
Gets the value of a property on files, dirs, or revisions.
Parameters
- propertyName: {string} The property to get from path.
- path: {string}/{table} The path or URL to get the specified property from.
- options: {table} [OPT] Options table. Possible Options: revision, depth
Return value:
{table} Table of properties. The list will contain tables where the keys are the path, and the values are a property table. In the property table there are keys of property names to their value, both as strings.See also:
- SubLua:PropSet (propName, propValue, path, options)
-
Parameters
- propName: {string} The property name to set.
- propValue: {string} The value of the property to set
- path: {string} Path where property to be set
- options: {table} Options table. Possible Options: depth
See also:
- SubLua:Revert (path, options)
-
Revert files and directories from version control.
Parameters
- path: {string}/{table} The path(s) or URL(s) to revert.
- options: {table} [OPT] Options table. Possible Options: depth
See also:
- SubLua:Unlock (path, options)
-
Unlocks files and directories.
Parameters
- path: {string}/{table} The path(s) or URL(s) to revert.
- options: {table} [OPT] Options table. Possible Options: force
See also:
- SubLua:Update (path, options)
-
Updates the file or directory.
Parameters
- path: {string} The path or URL to output.
- options: {table} [OPT] Options table. Possible Options: revision, depth, set_depth, ignore_externals, force
Return value:
Revision of the checkout.See also:
Tables
- Enums
- The Subverison enums. These are part of the SubLua object returned after calling new().
Fields
- wc.notify.action.add: Adding a path to revision control.
- wc.notify.action.copy: Copying a versioned path.
- wc.notify.action.delete: Deleting a versioned path.
- wc.notify.action.restore: Restoring a missing path from the pristine text-base.
- wc.notify.action.revert: Reverting a modified path.
- wc.notify.action.failed_revert: A revert operation has failed.
- wc.notify.action.resolved: Resolving a conflict.
- wc.notify.action.skip: Skipping a path.
- wc.notify.action.update_delete: Got a delete in an update.
- wc.notify.action.update_add: Got an add in an update.
- wc.notify.action.update_update: Got any other action in an update.
- wc.notify.action.update_completed: The last notification in an update (including updates of externals).
- wc.notify.action.update_external: Updating an external module.
- wc.notify.action.status_completed: The last notification in a status (including status on externals).
- wc.notify.action.status_external: Running status on an external module.
- wc.notify.action.commit_modified: Committing a modification.
- wc.notify.action.commit_added: Committing an addition.
- wc.notify.action.commit_deleted: Committing a deletion.
- wc.notify.action.commit_replaced: Committing a replacement.
- wc.notify.action.commit_postfix_txdelta: Transmitting post-fix text-delta data for a file.
- wc.notify.action.blame_revision: Processed a single revision's blame.
- wc.notify.action.locked: Locking a path. New in 1.2.
- wc.notify.action.unlocked: Unlocking a path. New in 1.2.
- wc.notify.action.failed_lock: Failed to lock a path. New in 1.2.
- wc.notify.action.failed_unlock: Failed to unlock a path. New in 1.2.
- wc.notify.action.exists: Tried adding a path that already exists. New in 1.5.
- wc.notify.action.changelist_set: Changelist name set. New in 1.5.
- wc.notify.action.changelist_clear: Changelist name cleared. New in 1.5.
- wc.notify.action.changelist_moved: Warn user that a path has moved from one changelist to another. New in 1.5. Deprecated: As of 1.7, separate clear and set notifications are sent.
- wc.notify.action.merge_begin: A merge operation (to path) has begun. See svn_-- @field wc.notify.action.merge_range. New in 1.5.
- wc.notify.action.foreign_merge_begin: A merge operation (to path) from a foreign repository has begun. See -- @field wc.notify.action.merge_range. New in 1.5.
- wc.notify.action.update_replace: Replace notification. New in 1.5.
- wc.notify.action.property_added: Property added. New in 1.6.
- wc.notify.action.property_modified: Property updated. New in 1.6.
- wc.notify.action.property_deleted: Property deleted. New in 1.6.
- wc.notify.action.property_deleted_nonexistentNonexistent: property deleted. New in 1.6.
- wc.notify.action.revprop_set: Revprop set. New in 1.6.
- wc.notify.action.revprop_deleted: Revprop deleted. New in 1.6.
- wc.notify.action.merge_completed: The last notification in a merge. New in 1.6.
- wc.notify.action.tree_conflict: The path is a tree-conflict victim of the intended action (*not* a persistent tree-conflict from an earlier operation, but *this* operation caused the tree-conflict). New in 1.6.
- wc.notify.action.failed_external: The path is a subdirectory referenced in an externals definition which is unable to be operated on. New in 1.6.
- wc.notify.action.update_started: Starting an update operation. New in 1.7.
- wc.notify.action.update_skip_obstruction: An update tried to add a file or directory at a path where a separate working copy was found. New in 1.7.
- wc.notify.action.update_skip_working_only: An explicit update tried to update a file or directory that doesn't live in the repository and can't be brought in. New in 1.7.
- wc.notify.action.update_skip_access_denied: An update tried to update a file or directory to which access could not be obtained. New in 1.7.
- wc.notify.action.update_external_removed: An update operation removed an external working copy. New in 1.7.
- wc.notify.action.update_shadowed_add: A node below an existing node was added during update. New in 1.7.
- wc.notify.action.update_shadowed_update: A node below an exising node was updated during update. New in 1.7.
- wc.notify.action.update_shadowed_delete: A node below an existing node was deleted during update. New in 1.7.
- wc.notify.action.merge_record_info: The mergeinfo on path was updated. New in 1.7.
- wc.notify.action.upgraded_path: An working copy directory was upgraded to the latest format. New in 1.7.
- wc.notify.action.merge_record_info_begin: Mergeinfo describing a merge was recorded. New in 1.7.
- wc.notify.action.merge_elide_info: Mergeinfo was removed due to elision. New in 1.7.
- wc.notify.action.patch: A file in the working copy was patched. New in 1.7.
- wc.notify.action.patch_applied_hunk: A hunk from a patch was applied. New in 1.7.
- wc.notify.action.patch_rejected_hunk: A hunk from a patch was rejected. New in 1.7.
- wc.notify.action.patch_hunk_already_applied: A hunk from a patch was found to already be applied. New in 1.7.
- wc.notify.action.commit_copied: Committing a non-overwriting copy (path is the target of the copy, not the source). New in 1.7.
- wc.notify.action.commit_copied_replaced: Committing an overwriting (replace) copy (path is the target of the copy, not the source). New in 1.7.
- wc.notify.action.url_redirect: The server has instructed the client to follow a URL redirection. New in 1.7.
- wc.notify.action.path_nonexistent: The operation was attempted on a path which doesn't exist. New in 1.7.
- wc.notify.action.exclude: Removing a path by excluding it. New in 1.7.
- wc.notify.action.failed_conflict: Operation failed because the node remains in conflict. New in 1.7.
- wc.notify.action.failed_missing: Operation failed because an added node is missing. New in 1.7.
- wc.notify.action.failed_out_of_date: Operation failed because a node is out of date. New in 1.7.
- wc.notify.action.failed_no_parent: Operation failed because an added parent is not selected. New in 1.7.
- wc.notify.action.failed_locked: Operation failed because a node is locked by another user and/or working copy. New in 1.7.
- wc.notify.action.failed_forbidden_by_server: Operation failed because the operation was forbidden by the server. New in 1.7.
- wc.notify.action.skip_conflicted: The operation skipped the path because it was conflicted. New in 1.7.
- Options
- The Options class.
Fields
- revision: the revision you want to update to; defaults to "HEAD".
- peg: the peg revision you want to update using; defaults to "HEAD".
- depth: limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity'); defaults to unknown.
- force: force operation to run; defaults to false.
- ignore_externals: set to ignore the externals; defaults to false.
- ignore_keywords: set to ignore the keyword substitution; defaults to false.
- no_ignore: set to disregard default and svn:ignore property ignores; defaults to false.
- native_eol: use a different EOL marker than the standard system marker for files with the svn:eol-style property set to 'native'. ARG may be one of 'LF', 'CR', 'CRLF'; defaults to NULL (no change).
- set_depth: set new working copy depth to depth. If depth is not specified then this does nothing; defaults to false.
- parents: If true, create any non-existent parent directories also; defaults to false.
- add_parents: If true, recurse up path's directory and look for a versioned directory. If found, add all intermediate paths between it and path; defaults to false.
- keep_changelists: After the commit completes successfully, remove changelist associations from the targets, unless keep_changelists is true; defaults to false.
- keep_locks: Unlock paths in the repository, unless keep_locks is true; defaults to false.
- auto_props: Enable automatic properties; defaults to true.
- ignore_unknown_node_types: Ignore files of which the node type is unknown, such as device files and pipes.; defaults to false.
- keep_local: if true then the paths will not be removed from the working copy, only scheduled for removal from the repository. Once the scheduled deletion is committed, they will appear as unversioned paths in the working copy; defaults to false.
- no_diff_deleting: Do not print differences for deleted files; defaults to false.
- notice_ancestry: Notice ancestry when calculating differences; defaults to false.
- SvnInfo
- The SvnInfo class.
Fields
- isValid: Is it valid?
- url: The url
- revision: The revision
- kind: The kind
- rootUrl: The root URL
- uuid: The uuid
- lastChangedRevision: Last changed revision
- lastChangedDate: Last changed date
- lastChangedAuthor: Last changed author
- lock: Lock
- hasWCInfo: Has working copy info?
- schedule: The schedule
- copyFromUrl: Copy from URL
- copyFromRev: Copy from revision
- textTime: Time in text
- propTime: Properties time
- checksum: The checksum
- conflictOld: Conflict old
- conflictNew: Conflict new
- conflictWrk: Conflict working
- propRejectFile: Prop reject file
- changelist: The changelist
- depth: Depth
- workingSize: Working size
- size: Size
- size64: Size64
- workingSize64: Working Size64
- treeConflict: the TreeConflict