fab.tools.versioning#
This file contains the base class for versioning tools like git and subversion. It also contains derived classes Git, Subversion, and Fcm.
Classes
|
This is the base class for FCM. |
|
This is the base class for git. |
|
This is the base class for subversion. |
|
This is the base class for versioning tools like git and svn. |
- class fab.tools.versioning.Versioning(name, exec_name, category)#
This is the base class for versioning tools like git and svn.
- class fab.tools.versioning.Git#
This is the base class for git.
- current_commit(folder=None)#
- init(folder)#
Initialises a directory.
- clean(folder)#
Removes all non versioned files in a directory.
- fetch(src, dst, revision)#
Runs git fetch in the specified directory
- checkout(src, dst='', revision=None)#
Checkout or update a Git repo.
- merge(dst, revision=None)#
Merge a git repo into a local working copy. If the merge fails, it will run git merge –abort to clean the directory.
- class fab.tools.versioning.Subversion(name=None, exec_name=None, category=Category.SUBVERSION)#
This is the base class for subversion. Note that this is also the base class for FCM, so it allows overwriting name, exec_name and category, but will default to use svn.
- Parameters:
- execute(pre_commands=None, revision=None, post_commands=None, env=None, cwd=None, capture_output=True)#
Executes a svn command.
- Parameters:
pre_commands (
Optional
[List
[str
]]) – List of strings to be sent tosubprocess.run()
as the command. (default:None
)revision (
Union
[int
,str
,None
]) – optional revision number as argument (default:None
)post_commands (
Optional
[List
[str
]]) – List of additional strings to be sent tosubprocess.run()
after the optional revision number. (default:None
)env (
Optional
[Dict
[str
,str
]]) – Optional env for the command. By default it will use the current session’s environment. (default:None
)capture_output – If True, capture and return stdout. If False, the command will print its output directly to the console. (default:
True
)
- Return type:
- export(src, dst, revision=None)#
Runs svn export.
- checkout(src, dst, revision=None)#
Runs svn checkout.
- update(dst, revision=None)#
Runs svn checkout.
- class fab.tools.versioning.Fcm#
This is the base class for FCM. All commands will be mapped back to the corresponding subversion commands.