• Home
  • Raw
  • Download

Lines Matching +full:sparse +full:- +full:checkout

1 # -*- coding: utf-8 -*-
3 # Use of this source code is governed by a BSD-style license that can be
50 """Returns the nearest higher-level repo dir from the specified path.
60 """Get the root of your repo managed checkout."""
69 """Tests to see if a directory is the root of a git submodule checkout.
78 ['git', '--git-dir', path, 'config', 'remote.%s.url' % remote],
80 check=False, encoding='utf-8').output.strip()
90 pwd: Directory to probe. If a checkout, should be the root.
97 # Is this directory a bare repo with no checkout?
113 cmd = ['fsck', '--no-progress', '--no-dangling']
129 If full is True, then it must be full length- 40 chars. If False, >=6, and
154 short: If set, output shorter unique SHA-1.
157 Revision SHA-1.
159 cmd = ['rev-parse', branch]
161 cmd.insert(1, '--short')
180 RunGit(cwd, ['merge-base', '--is-ancestor', to_ref, from_ref])
199 RunGit(cwd, ['rev-list', '-n1', commit, '--'])
210 ret = RunGit(cwd, ['symbolic-ref', '-q', 'HEAD'])
234 return ref.split('/', 3)[-1]
259 """Attributes of a given project in the manifest checkout.
268 attrs: The attributes associated with this checkout, as a dictionary.
313 """Get the path to the checkout.
390 """Stores the default manifest properties and per-project overrides."""
403 checkout = self.checkouts_by_name.setdefault(self._current_project_name,
405 checkout.append(attrs)
434 for checkout in self.checkouts_by_name[self._current_project_name]:
435 checkout.update(self._annotations)
458 # 'repo manifest -r' adds an 'upstream' attribute to the project tag for the
464 # repo checkout from a revlocked manifest, the 'upstream' attribute will
547 """A Manifest Handler for a specific manifest checkout."""
555 path: Path into a manifest checkout (doesn't have to be the root).
557 in the root of the checkout is used. May be a seekable file handle.
593 """Returns True iff the given checkout is using a full manifest.
598 checkout_root: path to the root of an SDK checkout.
606 cmd = ['config', '--local', '--get', 'manifest.groups']
626 for checkout in self.checkouts_by_name.get(project, []):
627 tracking_branch = checkout['tracking_branch']
629 checkouts.append(checkout)
633 """Returns the checkout associated with a given project/branch.
638 strict: Raise AssertionError if a checkout cannot be found.
644 AssertionError if there is more than one checkout associated with the
650 raise AssertionError('Could not find checkout of %s' % (project,))
670 checkout, return None.
674 strict: If True, fail when no checkout is found.
677 None if no checkout is found, else the checkout.
686 for checkout in self.ListCheckouts():
687 if path.startswith(checkout['local_path'] + '/'):
688 candidates.append((checkout['path'], checkout))
695 # The checkout with the greatest common path prefix is the owner of
721 # target for `repo init -u url -b some-branch` usages (aka, 'master'
743 # pylint: disable=arguments-differ
749 path: The pathway into a checkout; the root will be found automatically.
794 kwargs.setdefault('encoding', 'utf-8')
817 documentation for `git clone --reference`.
828 cmd += ['--reference', reference]
830 cmd += ['--depth', str(int(depth))]
832 cmd += ['--branch', branch]
834 cmd += ['--single-branch']
851 osutils.WriteFile(os.path.join(git_repo, '.git/info/sparse-checkout'),
853 logging.info('Sparse checkout: %s', sparse_checkout)
858 RunGit(git_repo, ['fetch', '--depth=1'],
863 logging.info('ShallowFetch completed in %s.', utcnow() - start)
867 """Returns the top-level directory of the given git working tree path."""
869 ret = RunGit(path, ['rev-parse', '--show-toplevel'])
893 output = RunGit(git_repo, ['ls-remote', git_repo, namespace + '*']).output
957 cmd = ['config', '--get-regexp',
997 recurse=recurse - 1)
1030 checkout = manifest.FindCheckoutFromPath(git_repo, strict=False)
1032 if checkout is None:
1036 checkout.AssertPushable()
1039 remote = checkout['push_remote']
1041 remote = checkout['remote']
1044 revision = checkout['tracking_branch']
1046 revision = checkout['revision']
1050 project_name = checkout.get('name', None)
1120 cmd = ['checkout', '-B', branch, branch_point]
1122 cmd.append('--track')
1133 RunGit(dirname, ['add', '--', filename])
1143 RunGit(dirname, ['rm', '--', filename])
1156 binary: If true, return bytes instead of decoding as a UTF-8 string.
1162 encoding = None if binary else 'utf-8'
1174 RunGit(git_repo, ['checkout', rev, '--', filename])
1177 # In Log, we use "format" to refer to the --format flag to
1179 # pylint: disable=redefined-builtin
1189 format: Passed directly to the --format flag.
1190 after: Passed directly to --after flag.
1191 until: Passed directly to --until flag.
1192 reverse: If true, set --reverse flag.
1193 date: Passed directly to --date flag.
1194 max_count: Passed directly to --max-count flag.
1195 grep: Passed directly to --grep flag.
1197 paths: List of paths to log commits for (enumerated after final -- ).
1204 cmd.append('--format=%s' % format)
1206 cmd.append('--after=%s' % after)
1208 cmd.append('--until=%s' % until)
1210 cmd.append('--reverse')
1212 cmd.append('--date=%s' % date)
1214 cmd.append('--max-count=%s' % max_count)
1216 cmd.append('--grep=%s' % grep)
1219 cmd.append('--')
1222 # pylint: enable=redefined-builtin
1226 """Retrieve the Change-Id from the commit message
1233 The Gerrit Change-Id assigned to the commit if it exists.
1236 m = re.findall(r'^Change-Id: (I[a-fA-F0-9]{40})$', log, flags=re.M)
1240 raise ValueError('Too many Change-Ids found')
1257 The Gerrit Change-ID assigned to the CL if it exists.
1259 cmd = ['commit', '-m', message]
1261 cmd.append('--amend')
1263 cmd.append('--allow-empty')
1265 cmd.append('--reset-author')
1278 r':(?P<src_mode>[0-7]*) (?P<dst_mode>[0-7]*) '
1279 r'(?P<src_sha>[0-9a-f]*)(\.)* (?P<dst_sha>[0-9a-f]*)(\.)* '
1280 r'(?P<status>[ACDMRTUX])(?P<score>[0-9]+)?\t'
1296 cmd = ['diff', '-M', '--raw', target]
1340 force: Whether to bypass non-fastforward checks.
1348 cmd.append('--force')
1350 cmd.append('--dry-run')
1380 RunGit(git_repo, ['checkout', '-B', branch, '-t', remote_push_branch.ref])
1412 RunGit(git_repo, [subcommand, '--abort'], check=False, **kwargs)
1428 dryrun: Git push --dry-run if set to True.
1430 auto_merge: Enable Gerrit's auto-merge feature. See here for more info:
1431 https://gerrit-review.googlesource.com/Documentation/user-upload.html#auto_merge
1475 """Remove all local changes and checkout a detached head.
1480 RunGit(git_repo, ['am', '--abort'], check=False)
1481 RunGit(git_repo, ['rebase', '--abort'], check=False)
1482 RunGit(git_repo, ['clean', '-dfx'])
1483 RunGit(git_repo, ['checkout', '--detach', '-f', 'HEAD'])
1487 """Remove all local changes and checkout the latest origin.
1500 RunGit(git_repo, ['checkout', remote_ref.ref])
1518 # Ensure the manifest knows of this checkout.
1525 # Not a manifest checkout.
1527 "Chromite checkout at %s isn't controlled by repo, nor is it on a "
1529 'Falling back to assuming the chromite checkout is derived from '
1541 # Use --auto so it only runs if housekeeping is necessary.
1542 cmd = ['gc', '--auto']
1544 cmd.append('--prune=all')