|
OpenQuizz
Une application de gestion des contenus pédagogiques
|


Public Member Functions | |
| def | __init__ (self, repo, name) |
| def | __getattr__ (self, attr) |
| def | __str__ (self) |
| def | __repr__ (self) |
| def | __eq__ (self, other) |
| def | __ne__ (self, other) |
| def | __hash__ (self) |
| def | exists (self) |
| def | iter_items (cls, repo) |
| def | set_url (self, new_url, old_url=None, **kwargs) |
| def | add_url (self, url, **kwargs) |
| def | delete_url (self, url, **kwargs) |
| def | urls (self) |
| def | refs (self) |
| def | stale_refs (self) |
| def | create (cls, repo, name, url, **kwargs) |
| def | remove (cls, repo, name) |
| def | rename (self, new_name) |
| def | update (self, **kwargs) |
| def | fetch (self, refspec=None, progress=None, verbose=True, **kwargs) |
| def | pull (self, refspec=None, progress=None, **kwargs) |
| def | push (self, refspec=None, progress=None, **kwargs) |
| def | config_reader (self) |
| def | config_writer (self) |
Public Member Functions inherited from Iterable | |
| def | list_items (cls, repo, *args, **kwargs) |
| def | iter_items (cls, repo, *args, **kwargs) |
Data Fields | |
| repo | |
| name | |
Static Public Attributes | |
| add | |
| rm | |
Provides easy read and write access to a git remote. Everything not part of this interface is considered an option for the current remote, allowing constructs like remote.pushurl to query the pushurl. NOTE: When querying configuration, the configuration accessor will be cached to speed up subsequent accesses.
| def __init__ | ( | self, | |
| repo, | |||
| name | |||
| ) |
Initialize a remote instance :param repo: The repository we are a remote of :param name: the name of the remote, i.e. 'origin'
| def __eq__ | ( | self, | |
| other | |||
| ) |
| def __getattr__ | ( | self, | |
| attr | |||
| ) |
Allows to call this instance like remote.special( \\*args, \\*\\*kwargs) to call git-remote special self.name
| def __hash__ | ( | self | ) |
| def __ne__ | ( | self, | |
| other | |||
| ) |
| def __repr__ | ( | self | ) |
| def __str__ | ( | self | ) |
| def add_url | ( | self, | |
| url, | |||
| ** | kwargs | ||
| ) |
Adds a new url on current remote (special case of git remote set_url) This command adds new URLs to a given remote, making it possible to have multiple URLs for a single remote. :param url: string being the URL to add as an extra remote URL :return: self
| def config_reader | ( | self | ) |
:return:
GitConfigParser compatible object able to read options for only our remote.
Hence you may simple type config.get("pushurl") to obtain the information
| def config_writer | ( | self | ) |
:return: GitConfigParser compatible object able to write options for this remote.
:note:
You can only own one writer at a time - delete it to release the
configuration file and make it usable by others.
To assure consistent results, you should only query options through the
writer. Once you are done writing, you are free to use the config reader
once again.
| def create | ( | cls, | |
| repo, | |||
| name, | |||
| url, | |||
| ** | kwargs | ||
| ) |
Create a new remote to the given repository :param repo: Repository instance that is to receive the new remote :param name: Desired name of the remote :param url: URL which corresponds to the remote's name :param kwargs: Additional arguments to be passed to the git-remote add command :return: New Remote instance :raise GitCommandError: in case an origin with that name already exists
| def delete_url | ( | self, | |
| url, | |||
| ** | kwargs | ||
| ) |
Deletes a new url on current remote (special case of git remote set_url) This command deletes new URLs to a given remote, making it possible to have multiple URLs for a single remote. :param url: string being the URL to delete from the remote :return: self
| def exists | ( | self | ) |
:return: True if this is a valid, existing remote.
Valid remotes have an entry in the repository's configuration
| def fetch | ( | self, | |
refspec = None, |
|||
progress = None, |
|||
verbose = True, |
|||
| ** | kwargs | ||
| ) |
Fetch the latest changes for this remote
:param refspec:
A "refspec" is used by fetch and push to describe the mapping
between remote ref and local ref. They are combined with a colon in
the format <src>:<dst>, preceded by an optional plus sign, +.
For example: git fetch $URL refs/heads/master:refs/heads/origin means
"grab the master branch head from the $URL and store it as my origin
branch head". And git push $URL refs/heads/master:refs/heads/to-upstream
means "publish my master branch head as to-upstream branch at $URL".
See also git-push(1).
Taken from the git manual
Fetch supports multiple refspecs (as the
underlying git-fetch does) - supplying a list rather than a string
for 'refspec' will make use of this facility.
:param progress: See 'push' method
:param verbose: Boolean for verbose output
:param kwargs: Additional arguments to be passed to git-fetch
:return:
IterableList(FetchInfo, ...) list of FetchInfo instances providing detailed
information about the fetch results
:note:
As fetch does not provide progress information to non-ttys, we cannot make
it available here unfortunately as in the 'push' method.
| def iter_items | ( | cls, | |
| repo | |||
| ) |
:return: Iterator yielding Remote objects of the given repository
| def pull | ( | self, | |
refspec = None, |
|||
progress = None, |
|||
| ** | kwargs | ||
| ) |
Pull changes from the given branch, being the same as a fetch followed by a merge of branch with your local branch. :param refspec: see 'fetch' method :param progress: see 'push' method :param kwargs: Additional arguments to be passed to git-pull :return: Please see 'fetch' method
| def push | ( | self, | |
refspec = None, |
|||
progress = None, |
|||
| ** | kwargs | ||
| ) |
Push changes from source branch in refspec to target branch in refspec.
:param refspec: see 'fetch' method
:param progress:
Can take one of many value types:
* None to discard progress information
* A function (callable) that is called with the progress information.
Signature: ``progress(op_code, cur_count, max_count=None, message='')``.
`Click here <http://goo.gl/NPa7st>`__ for a description of all arguments
given to the function.
* An instance of a class derived from ``git.RemoteProgress`` that
overrides the ``update()`` function.
:note: No further progress information is returned after push returns.
:param kwargs: Additional arguments to be passed to git-push
:return:
list(PushInfo, ...) list of PushInfo instances, each
one informing about an individual head which had been updated on the remote
side.
If the push contains rejected heads, these will have the PushInfo.ERROR bit set
in their flags.
If the operation fails completely, the length of the returned IterableList will
be 0.
| def refs | ( | self | ) |
:return:
IterableList of RemoteReference objects. It is prefixed, allowing
you to omit the remote path portion, i.e.::
remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')
| def remove | ( | cls, | |
| repo, | |||
| name | |||
| ) |
Remove the remote with the given name :return: the passed remote name to remove
| def rename | ( | self, | |
| new_name | |||
| ) |
Rename self to the given new_name :return: self
| def set_url | ( | self, | |
| new_url, | |||
old_url = None, |
|||
| ** | kwargs | ||
| ) |
Configure URLs on current remote (cf command git remote set_url) This command manages URLs on the remote. :param new_url: string being the URL to add as an extra remote URL :param old_url: when set, replaces this URL with new_url for the remote :return: self
| def stale_refs | ( | self | ) |
:return:
IterableList RemoteReference objects that do not have a corresponding
head in the remote reference anymore as they have been deleted on the
remote side, but are still available locally.
The IterableList is prefixed, hence the 'origin' must be omitted. See
'refs' property for an example.
To make things more complicated, it can be possible for the list to include
other kinds of references, for example, tag references, if these are stale
as well. This is a fix for the issue described here:
https://github.com/gitpython-developers/GitPython/issues/260
| def update | ( | self, | |
| ** | kwargs | ||
| ) |
Fetch all changes for this remote, including new branches which will
be forced in ( in case your local remote branch is not part the new remote branches
ancestry anymore ).
:param kwargs:
Additional arguments passed to git-remote update
:return: self
| def urls | ( | self | ) |
:return: Iterator yielding all configured URL targets on a remote as strings
|
static |
| name |
| repo |
|
static |