Пример #1
0
def get_truncated_log(repo: Repo, commit: Head, tail_sha: str) -> List[Commit]:
    fifty_first_commits = list(repo.iter_commits(commit, max_count=100))
    commits_after_tail: List[Commit] = []
    found_tail = False
    for c in fifty_first_commits:
        if (found_tail == True):
            continue
        if (c.hexsha == tail_sha):
            found_tail = True
            continue
        commits_after_tail.append(c)
    return commits_after_tail
Пример #2
0
from setuptools import setup
from git.repo.base import Repo
from os.path import dirname, realpath, exists
import os

vcs = Repo(dirname(realpath(__file__)))
urls = [u for u in vcs.remote().urls]
if len(urls) < 1:
    raise NotImplementedError()
versionnum = (
    len([c
         for c in vcs.iter_commits()]) - 116  # version 0.0.* had 115 revisions
    - 57  # version 0.1.* had 56 revisions
    - 71  # version 0.2.* had 70 revisions
)
versionstr = "0.3.%d" % versionnum
print("Current version %s" % versionstr)

logfile = os.path.join(os.sep, "var", "log", "simple_shuffle.log")

# HACK: This requires that the permissions be changed manually, needs to be
# fixed. How to determine the user executing a command as sudo?
if not exists(logfile):
    open(logfile, 'w').close()

setup(name="Simple Shuffle",
      version=versionstr,
      author="D. Scott Boggs",
      author_email="*****@*****.**",
      description="Shuffles a folder of music. That is all.",
      license="GPLv3",
Пример #3
0
from os.path import dirname, realpath
# from pip import main as pip

try:
    from git.repo.base import Repo
except ImportError:
    # install from pip on failure to import -- This is a dependency of the
    # install script itself.
    #    if pip(["install", "gitpython"]):
    raise

vcs = Repo(dirname(realpath(__file__)))
# urls = [u for u in vcs.remote().urls]
# if len(urls) < 1:
#    raise NotImplementedError()
versionnum = len([c for c in vcs.iter_commits()])
versionstr = "0.0.%d" % versionnum

setup(name="ShoppingList",
      version=versionstr,
      author="D. Scott Boggs",
      author_email="*****@*****.**",
      description="A ReSTful list API.",
      license="GPL-v3.0",
      keywords="shopping list api rest http flask",
      packages=["api", "tests"],
      tests_require=["pytest"],
      install_requires=[
          "Flask", "flask-sqlalchemy", "flask-migrate", "flask-login"
      ],
      setup_requires=['pytest-runner'])
Пример #4
0
def generate_account_history(ddir: Path) -> Iterator[Snapshot]:
    repo = Repo(str(ddir))
    yield from unique_snapshots(
        strip(map(get_contents_at_commit, repo.iter_commits()), lambda s: s is None)  # type: ignore
    )