• Home
  • Raw
  • Download

Lines Matching +full:base +full:- +full:repo

8 #      http://www.apache.org/licenses/LICENSE-2.0
32 # Check https://gitlab.freedesktop.org/wayland/wayland-protocols/-/tags
44 def __init__(self, base: pathlib.PurePath):
45 logging.debug("GitRepo base %s", base)
46 self._base = base
49 def base(self) -> pathlib.PurePath: member in GitRepo
50 """Gets the base path used the repo."""
56 check: bool = True) -> subprocess.CompletedProcess:
57 return subprocess.run(['git', '-C', self._base] + cmd,
62 def get_hash_for_version(self, version) -> str:
65 return self._git(['show-ref', '--hash',
68 def git_ref_name_for_version(self, version) -> str | None:
71 ref = self._git(['describe', '--all', '--exact-match', version],
80 paths: list[pathlib.PurePath]) -> list[pathlib.Path]:
84 ['ls-tree', '-r', '--name-only', f'{version}^{{tree}}'] +
88 def assert_no_uncommitted_changes(self) -> None:
89 """Asserts that the repo has no uncommited changes."""
90 r = self._git(['diff-files', '--quiet', '--ignore-submodules'],
96 'diff-index', '--quiet', '--ignore-submodules', '--cached', 'HEAD'
106 force_clean: bool = True) -> None:
107 """Performs a sparse clone with depth=1 of a repo.
110 all the files available in the repo.
128 |force_clean| ensures any existing checkout at |base| is removed.
141 cmd = ['git', 'clone', '--filter=blob:none', '--depth=1']
143 cmd.extend(['--sparse'])
145 cmd.extend(['-b', version])
151 self._git(['sparse-checkout', 'add'] + paths)
153 def add(self, path: pathlib.Path) -> None:
161 auto_add: bool = True) -> None:
169 cmd = ['commit', '-m', message]
171 cmd.extend(['--allow-empty'])
173 cmd.extend(['-a'])
198 def _read_content(self) -> None:
203 def _write_content(self) -> None:
208 def _read_raw_git_urls(self) -> None:
218 if '/-/tree/' in url:
219 base_url, path = url.split('/-/tree/')
237 def current_version(self) -> str:
249 def git_url(self) -> str:
255 def git_paths(self) -> list[pathlib.PurePath]:
258 This can be an empty list if the entire repo should be synced.
263 def update_version_and_import_date(self, version: str) -> None:
282 def must_ignore(path: pathlib.PurePath) -> bool:
312 parser.add_argument('--loglevel',
318 parser.add_argument('--no-force-clean',
325 '--no-remove-old-files',
337 base = pathlib.Path(sys.argv[0]).parent.resolve().absolute()
338 assert base.exists()
344 target_git = GitRepo(base)
346 target_group_path = base / args.group
351 import_new_git = GitRepo(base / '.import' / args.group / (args.version))
365 import_old_git = GitRepo(base / '.import' / args.group /
388 src: pathlib.Path = import_new_git.base / path