
    jm                     &    d dl mZ  G d de      Zy)   )	constantsc                   f     e Zd ZU dZedz  ed<   eed<   d	dededz  dd f fdZd ZdefdZ xZ	S )
ResolvedRevisiona  A git revision that has already been resolved to a commit hash.

    `ResolvedRevision` is a `str` subclass, so it can be passed to any `huggingface_hub` method taking a `revision`
    argument. Its string value is the revision initially requested by the user (e.g. `"main"`, `"refs/pr/4"`),
    which keeps URLs and error messages readable, while `.resolved` holds the commit hash it points to.

    Instances are built by [`HfApi.resolve_revision`], which also caches the `revision` -> `commit hash` mapping
    in the local cache (`refs/` folder).

    Attributes:
        initial (`str` or `None`):
            The revision initially requested by the user. If `None`, the string value defaults to `"main"`.
        resolved (`str`):
            The commit hash that `initial` resolves to.

    Example:
    ```python
    >>> from huggingface_hub import resolve_revision
    >>> revision = resolve_revision("openai-community/gpt2")
    >>> revision
    ResolvedRevision(initial=None, resolved='607a30d783dfa663caf39e06633721c8d4cfcd7e')
    >>> revision == "main"  # it's a string
    True
    >>> revision.resolved
    '607a30d783dfa663caf39e06633721c8d4cfcd7e'
    ```
    Ninitialresolvedreturnc                 h    t         |   | ||nt        j                        }||_        ||_        |S N)super__new__r   DEFAULT_REVISIONr   r   )clsr   r   revision	__class__s       /home/vela/workspace/domain/tn-silver/web/tn-site/.runtime/depth-eval/venv/lib/python3.12/site-packages/huggingface_hub/_revision.pyr   zResolvedRevision.__new__$   s5    7?373FILfLfg"$    c                 J    | j                   | j                  | j                  ffS r
   )r   r   r   selfs    r   
__reduce__zResolvedRevision.__reduce__*   s    ~~t||<<<r   c                 <    d| j                   d| j                  dS )NzResolvedRevision(initial=z, resolved=))r   r   r   s    r   __repr__zResolvedRevision.__repr__.   s"    *4<<*:+dmmEVVWXXr   r
   )
__name__
__module____qualname____doc__str__annotations__r   r   r   __classcell__)r   s   @r   r   r      sK    8 4ZMs S4Z CU =Y# Yr   r   N) r   r   r    r   r   <module>r#      s    +Ys +Yr   