OpenQuizz
Une application de gestion des contenus pédagogiques
TagReference Class Reference
Inheritance diagram for TagReference:
Collaboration diagram for TagReference:

Public Member Functions

def commit (self)
 
def tag (self)
 
def create (cls, repo, path, ref='HEAD', message=None, force=False, **kwargs)
 
def delete (cls, repo, *tags)
 
- Public Member Functions inherited from Reference
def __init__ (self, repo, path, check_path=True)
 
def __str__ (self)
 
def set_object (self, object, logmsg=None)
 
def name (self)
 
def iter_items (cls, repo, common_path=None)
 
def remote_name (self)
 
def remote_head (self)
 
- Public Member Functions inherited from SymbolicReference
def __init__ (self, repo, path)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __hash__ (self)
 
def abspath (self)
 
def dereference_recursive (cls, repo, ref_path)
 
def set_commit (self, commit, logmsg=None)
 
def set_reference (self, ref, logmsg=None)
 
def is_valid (self)
 
def is_detached (self)
 
def log (self)
 
def log_append (self, oldbinsha, message, newbinsha=None)
 
def log_entry (self, index)
 
def to_full_path (cls, path)
 
def delete (cls, repo, path)
 
def create (cls, repo, path, reference='HEAD', force=False, logmsg=None)
 
def rename (self, new_path, force=False)
 
def from_path (cls, repo, path)
 
def is_remote (self)
 
- Public Member Functions inherited from Iterable
def list_items (cls, repo, *args, **kwargs)
 
def iter_items (cls, repo, *args, **kwargs)
 

Properties

 object = property(Reference._get_object)
 
- Properties inherited from SymbolicReference
 commit = property(_get_commit, set_commit, doc="Query or set commits directly")
 
 object = property(_get_object, set_object, doc="Return the object our ref currently refers to")
 
 reference = property(_get_reference, set_reference, doc="Returns the Reference we point to")
 

Additional Inherited Members

- Data Fields inherited from SymbolicReference
 repo
 
 path
 
- Static Public Attributes inherited from SymbolicReference
 ref
 

Detailed Description

Class representing a lightweight tag reference which either points to a commit
,a tag object or any other object. In the latter case additional information,
like the signature or the tag-creator, is available.

This tag object will always point to a commit object, but may carry additional
information in a tag object::

 tagref = TagReference.list_items(repo)[0]
 print(tagref.commit.message)
 if tagref.tag is not None:
    print(tagref.tag.message)

Member Function Documentation

◆ commit()

def commit (   self)
:return: Commit object the tag ref points to

:raise ValueError: if the tag points to a tree or blob

◆ create()

def create (   cls,
  repo,
  path,
  ref = 'HEAD',
  message = None,
  force = False,
**  kwargs 
)
Create a new tag reference.

:param path:
    The name of the tag, i.e. 1.0 or releases/1.0.
    The prefix refs/tags is implied

:param ref:
    A reference to the object you want to tag. It can be a commit, tree or
    blob.

:param message:
    If not None, the message will be used in your tag object. This will also
    create an additional tag object that allows to obtain that information, i.e.::

tagref.tag.message

:param force:
    If True, to force creation of a tag even though that tag already exists.

:param kwargs:
    Additional keyword arguments to be passed to git-tag

:return: A new TagReference

◆ delete()

def delete (   cls,
  repo,
tags 
)
Delete the given existing tag or tags

◆ tag()

def tag (   self)
:return: Tag object this tag ref points to or None in case
    we are a light weight tag

Property Documentation

◆ object

object = property(Reference._get_object)
static

The documentation for this class was generated from the following file: