fab.tools.versioning module#
Versioning tools such as Subversion and Git.
- class fab.tools.versioning.Versioning(name, exec_name, category)#
-
Base class for versioning tools like Git and Subversion.
Constructor.
- class fab.tools.versioning.Git#
Bases:
Versioning
Interface to Git version control system.
Constructor.
- Parameters:
name – Display name of this tool.
exec_name – Executable for this tool.
category – Tool belongs to this category.
- 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)#
Bases:
Versioning
Interface to the Subversion version control system.
Constructor.
This is class is extended by the FCM interface which is why name and executable are mutable.
- 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#
Bases:
Subversion
This is the base class for FCM. All commands will be mapped back to the corresponding subversion commands.
Constructor.
This is class is extended by the FCM interface which is why name and executable are mutable.
- Parameters:
name – Tool name, defaults to “subversion.”
exec_name – Tool executable, defaults to “svn.”
category – Tool category, defaults to SUBVERSION.