7<ޗddlmZddgZddlmZmZmZmZddlm Z m Z erddl m Z ddl mZdd l mZdd lmZGd deZeZd S) ) Reference TagReferenceTag)AnyTypeUnion TYPE_CHECKING) Commit_ishPathLike)Repo)Commit) TagObject)SymbolicReferenceceZdZdZdZdZejdzezZeddZ ede dfd Z ede fd Z e ddeddddede edfde ed fdededdfdZeddZd S)raClass 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)tags/returnrc|j}|jdkr9|jdkr|j}ntd|d|jd|jdk9|S)zl:return: Commit object the tag ref points to :raise ValueError: if the tag points to a tree or blobcommittagzCannot resolve commit as tag z points to a z9 object - use the `.object` property instead to access it)objecttype ValueErrorselfobjs ^/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/git/refs/tag.pyrzTagReference.commit&sn kh(""x5  j j ttSXXX ' h("" )rNc.|j}|jdkr|SdS)zi :return: Tag object this tag ref points to or None in case we are a light weight tagrN)rrrs rrzTagReference.tag:s" k 8u  Jtr c*tj|S)N)r _get_object)rs rrzTagReference.objectHs$T***r HEADNFclsrepor path referencerlogmsgforcekwargsc d|vr|dr|d}d|vr|dr|d|d<|d=|r||d<|rd|d<||f}|jj|i|t||jd|S)aCreate 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. The Object can be a commit, tree or blob. :param logmsg: 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 message: Synonym for :param logmsg: Included for backwards compatibility. :param logmsg is used in preference if both given. :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 TagReferencerefmessagemTfr)gitrr_common_path_default)r%r&r'r(r)r*r+argss rcreatezTagReference.createLsJ F??ve}?u I   6)#4  +F3Ky!  ! F3K  F3Ki  d%f%%%DS-E-E-Ett"LMMMr c,|jjdg|RdS)z%Delete the given existing tag or tagsz-dN)r1r)r%r&rs rdeletezTagReference.deletes&  T!D!!!!!!r )rr)r$NF)r&r rrrN)__name__ __module__ __qualname____doc__ __slots___common_defaultrr2propertyrr rr r classmethodrr strboolrr4r6rr rrrsr % %IO$9C?/Q X&U,-X+ +++X+ 6<#' 4N4N . !4N4N4N112 4N c4i 4N  4N4N 4N4N4N[4Nl"""["""r N)r(r__all__typingrrr r git.typesr r git.repor git.objectsrrgit.refsrrrrr rrGs 5 !322222222222********+""""""%%%%%%****** r"r"r"r"r"9r"r"r"lr