rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
gclient_utils.RemoveDirectory(checkout_path)
gclient_utils.RemoveDirectory(self.checkout_path)
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
command = ['update', checkout_path]
command = ['update', self.checkout_path]
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
checkout_path = os.path.join(self._root_dir, self.relpath)
def updatesingle(self, options, args, file_list): checkout_path = os.path.join(self._root_dir, self.relpath) filename = args.pop() if scm.SVN.AssertVersion("1.5")[0]: if not os.path.exists(os.path.join(checkout_path, '.svn')): # Create an empty checkout and then update the one file we want. Future # operations will on...
if not os.path.exists(os.path.join(checkout_path, '.svn')):
if not os.path.exists(os.path.join(self.checkout_path, '.svn')):
def updatesingle(self, options, args, file_list): checkout_path = os.path.join(self._root_dir, self.relpath) filename = args.pop() if scm.SVN.AssertVersion("1.5")[0]: if not os.path.exists(os.path.join(checkout_path, '.svn')): # Create an empty checkout and then update the one file we want. Future # operations will on...
command = ["checkout", "--depth", "empty", self.url, checkout_path]
command = ["checkout", "--depth", "empty", self.url, self.checkout_path]
def updatesingle(self, options, args, file_list): checkout_path = os.path.join(self._root_dir, self.relpath) filename = args.pop() if scm.SVN.AssertVersion("1.5")[0]: if not os.path.exists(os.path.join(checkout_path, '.svn')): # Create an empty checkout and then update the one file we want. Future # operations will on...
if os.path.exists(os.path.join(checkout_path, filename)): os.remove(os.path.join(checkout_path, filename))
if os.path.exists(os.path.join(self.checkout_path, filename)): os.remove(os.path.join(self.checkout_path, filename))
def updatesingle(self, options, args, file_list): checkout_path = os.path.join(self._root_dir, self.relpath) filename = args.pop() if scm.SVN.AssertVersion("1.5")[0]: if not os.path.exists(os.path.join(checkout_path, '.svn')): # Create an empty checkout and then update the one file we want. Future # operations will on...
if not os.path.exists(checkout_path): os.makedirs(checkout_path)
if not os.path.exists(self.checkout_path): os.makedirs(self.checkout_path)
def updatesingle(self, options, args, file_list): checkout_path = os.path.join(self._root_dir, self.relpath) filename = args.pop() if scm.SVN.AssertVersion("1.5")[0]: if not os.path.exists(os.path.join(checkout_path, '.svn')): # Create an empty checkout and then update the one file we want. Future # operations will on...
os.path.join(checkout_path, filename)]
os.path.join(self.checkout_path, filename)]
def updatesingle(self, options, args, file_list): checkout_path = os.path.join(self._root_dir, self.relpath) filename = args.pop() if scm.SVN.AssertVersion("1.5")[0]: if not os.path.exists(os.path.join(checkout_path, '.svn')): # Create an empty checkout and then update the one file we want. Future # operations will on...
path = os.path.join(self._root_dir, self.relpath) if not os.path.isdir(path):
if not os.path.isdir(self.checkout_path):
def revert(self, options, args, file_list): """Reverts local modifications. Subversion specific.
for file_status in scm.SVN.CaptureStatus(path): file_path = os.path.join(path, file_status[1])
for file_status in scm.SVN.CaptureStatus(self.checkout_path): file_path = os.path.join(self.checkout_path, file_status[1])
def revert(self, options, args, file_list): """Reverts local modifications. Subversion specific.
path = os.path.join(self._root_dir, self.relpath)
def status(self, options, args, file_list): """Display status information.""" path = os.path.join(self._root_dir, self.relpath) command = ['status'] + args if not os.path.isdir(path): # svn status won't work if the directory doesn't exist. options.stdout.write( ('\n________ couldn\'t run \'%s\' in \'%s\':\nThe director...
if not os.path.isdir(path):
if not os.path.isdir(self.checkout_path):
def status(self, options, args, file_list): """Display status information.""" path = os.path.join(self._root_dir, self.relpath) command = ['status'] + args if not os.path.isdir(path): # svn status won't work if the directory doesn't exist. options.stdout.write( ('\n________ couldn\'t run \'%s\' in \'%s\':\nThe director...
'does not exist.') % (' '.join(command), path))
'does not exist.') % (' '.join(command), self.checkout_path))
def status(self, options, args, file_list): """Display status information.""" path = os.path.join(self._root_dir, self.relpath) command = ['status'] + args if not os.path.isdir(path): # svn status won't work if the directory doesn't exist. options.stdout.write( ('\n________ couldn\'t run \'%s\' in \'%s\':\nThe director...
kwargs.setdefault('cwd', os.path.join(self._root_dir, self.relpath))
kwargs.setdefault('cwd', self.checkout_path)
def _Run(self, args, options, **kwargs): """Runs a commands that goes to stdout.""" kwargs.setdefault('cwd', os.path.join(self._root_dir, self.relpath)) gclient_utils.CheckCallAndFilterAndHeader(['svn'] + args, always=options.verbose, stdout=options.stdout, **kwargs)
cwd = cwd or os.path.join(self._root_dir, self.relpath)
cwd = cwd or self.checkout_path
def _RunAndGetFileList(self, args, options, file_list, cwd=None): """Runs a commands that goes to stdout and grabs the file listed.""" cwd = cwd or os.path.join(self._root_dir, self.relpath) scm.SVN.RunAndGetFileList(options.verbose, args, cwd=cwd, file_list=file_list, stdout=options.stdout)
match = re.search(r"svn://.*/(.*)", branch_url)
match = re.search(r"^[a-z]+://.*/(.*)", branch_url)
def checkoutRevision(url, revision, branch_url, revert=False): files_info = getFileInfo(url, revision) paths = getBestMergePaths2(files_info, revision) export_map = getBestExportPathsMap2(files_info, revision) command = 'svn checkout -N ' + branch_url print command os.system(command) match = re.search(r"svn://.*/(.*)...
tree = dict((d.name, d) for d in self.tree(False)) if self.name in tree: raise gclient_utils.Error( 'Dependency %s specified more than once:\n %s\nvs\n %s' % (self.name, tree[self.name].hierarchy(), self.hierarchy()))
def __init__(self, parent, name, url, safesync_url=None, custom_deps=None, custom_vars=None, deps_file=None): GClientKeywords.__init__(self) self.parent = parent self.name = name self.url = url self.parsed_url = None # These 2 are only set in .gclient and not in DEPS files. self.safesync_url = safesync_url self.custom_...
__pychecker__ = 'unusednames=args,file_list,options'
__pychecker__ = 'unusednames=options,args,file_list'
def cleanup(self, options, args, file_list): """Cleanup working copy.""" __pychecker__ = 'unusednames=args,file_list,options' self._Run(['prune'], redirect_stdout=False) self._Run(['fsck'], redirect_stdout=False) self._Run(['gc'], redirect_stdout=False)
__pychecker__ = 'unusednames=args,file_list,options'
__pychecker__ = 'unusednames=options,args,file_list'
def diff(self, options, args, file_list): __pychecker__ = 'unusednames=args,file_list,options' merge_base = self._Run(['merge-base', 'HEAD', 'origin']) self._Run(['diff', merge_base], redirect_stdout=False)
__pychecker__ = 'unusednames=file_list,options'
__pychecker__ = 'unusednames=options,file_list'
def export(self, options, args, file_list): """Export a clean directory tree into the given path.
__pychecker__ = 'unusednames=file_list,options'
__pychecker__ = 'unusednames=options,file_list'
def pack(self, options, args, file_list): """Generates a patch file which can be applied to the root of the repository.
__pychecker__ = 'unusednames=args,file_list,options'
__pychecker__ = 'unusednames=options,args,file_list'
def revinfo(self, options, args, file_list): """Display revision""" __pychecker__ = 'unusednames=args,file_list,options' return self._Run(['rev-parse', 'HEAD'])
__pychecker__ = 'unusednames=args,options'
__pychecker__ = 'unusednames=options,args'
def status(self, options, args, file_list): """Display status information.""" __pychecker__ = 'unusednames=args,options' if not os.path.isdir(self.checkout_path): print('\n________ couldn\'t run status in %s:\nThe directory ' 'does not exist.' % self.checkout_path) else: merge_base = self._Run(['merge-base', 'HEAD', 'o...
if revision is not None:
if revision:
def DiffItem(filename, full_move=False, revision=None): """Diffs a single file.
def __init__(self, relpath):
def __init__(self, relpath, stdout):
def __init__(self, relpath): # Note that we always use '/' as the path separator to be # consistent with svn's cygwin-style output on Windows self._relpath = relpath.replace("\\", "/") self._current_file = "" self._replacement_file = ""
def ReplaceAndPrint(self, line): print(line.replace(self._current_file, self._replacement_file))
def _Replace(self, line): return line.replace(self._current_file, self._replacement_file)
def ReplaceAndPrint(self, line): print(line.replace(self._current_file, self._replacement_file))
self.ReplaceAndPrint(line)
line = self._Replace(line)
def Filter(self, line): if (line.startswith(self.index_string)): self.SetCurrentFile(line[len(self.index_string):]) self.ReplaceAndPrint(line) else: if (line.startswith(self.original_prefix) or line.startswith(self.working_prefix)): self.ReplaceAndPrint(line) else: print line
self.ReplaceAndPrint(line) else: print line
line = self._Replace(line) self._stdout.write(line + '\n')
def Filter(self, line): if (line.startswith(self.index_string)): self.SetCurrentFile(line[len(self.index_string):]) self.ReplaceAndPrint(line) else: if (line.startswith(self.original_prefix) or line.startswith(self.working_prefix)): self.ReplaceAndPrint(line) else: print line
print("\n_____ %s%s" % (self.relpath, rev_str))
options.stdout.write("\n_____ %s%s\n" % (self.relpath, rev_str))
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
self._Clone(revision, url, options.verbose)
self._Clone(revision, url, options)
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print ""
options.stdout.write('\n')
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print str(e) print "Sleeping 15 seconds and retrying..."
options.stdout.write(str(e) + '\n') options.stdout.write('Sleeping 15 seconds and retrying...\n')
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print remote_output.strip()
options.stdout.write(remote_output.strip() + '\n')
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print remote_err.strip()
options.stdout.write(remote_err.strip() + '\n')
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
self._CheckDetachedHead(rev_str)
self._CheckDetachedHead(rev_str, options)
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print("\n_____ %s%s" % (self.relpath, rev_str))
options.stdout.write('\n_____ %s%s\n' % (self.relpath, rev_str))
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
self._AttemptRebase(upstream_branch, files, verbose=options.verbose,
self._AttemptRebase(upstream_branch, files, options,
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
self._AttemptRebase(upstream_branch, files=files, verbose=options.verbose, printed_path=printed_path)
self._AttemptRebase(upstream_branch, files, options, printed_path=printed_path)
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print "Trying fast-forward merge to branch : %s" % upstream_branch
options.stdout.write('Trying fast-forward merge to branch : %s\n' % upstream_branch)
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print "Skipping %s" % self.relpath
options.stdout.write('Skipping %s\n' % self.relpath)
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print "Input not recognized"
options.stdout.write('Input not recognized\n')
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print e.stderr
options.stdout.write(e.stderr + '\n')
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print "Merge produced error output:\n%s" % merge_err.strip()
options.stdout.write('Merge produced error output:\n%s\n' % merge_err.strip())
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print "Checked out revision %s" % self.revinfo(options, (), None)
options.stdout.write('Checked out revision %s\n' % self.revinfo(options, (), None))
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
print("\n_____ %s is missing, synching instead" % self.relpath)
options.stdout.write('\n_____ %s is missing, synching instead\n' % self.relpath)
def revert(self, options, args, file_list): """Reverts local modifications.
print('\n________ couldn\'t run status in %s:\nThe directory ' 'does not exist.' % self.checkout_path)
options.stdout.write( ('\n________ couldn\'t run status in %s:\nThe directory ' 'does not exist.\n') % self.checkout_path)
def status(self, options, args, file_list): """Display status information.""" if not os.path.isdir(self.checkout_path): print('\n________ couldn\'t run status in %s:\nThe directory ' 'does not exist.' % self.checkout_path) else: merge_base = self._Run(['merge-base', 'HEAD', 'origin']) self._Run(['diff', '--name-status'...
def _Clone(self, revision, url, verbose=False):
def _Clone(self, revision, url, options):
def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL.
if not verbose:
if not options.verbose:
def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL.
print ""
options.stdout.write('\n')
def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL.
if verbose:
if options.verbose:
def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL.
print str(e) print "Retrying..."
options.stdout.write(str(e) + '\n') options.stdout.write('Retrying...\n')
def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL.
print \ "Checked out %s to a detached HEAD. Before making any commits\n" \ "in this repo, you should use 'git checkout <branch>' to switch to\n" \ "an existing branch or use 'git checkout origin -b <branch>' to\n" \ "create a new branch for your work." % revision def _AttemptRebase(self, upstream, files, verbose=False...
options.stdout.write( ('Checked out %s to a detached HEAD. Before making any commits\n' 'in this repo, you should use \'git checkout <branch>\' to switch to\n' 'an existing branch or use \'git checkout origin -b <branch>\' to\n' 'create a new branch for your work.') % revision) def _AttemptRebase(self, upstream, files...
def _Clone(self, revision, url, verbose=False): """Clone a git repository from the given URL.
print "\n_____ %s : Attempting rebase onto %s..." % (self.relpath, revision)
options.stdout.write('\n_____ %s : Attempting rebase onto %s...\n' % ( self.relpath, revision))
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
print "Attempting rebase onto %s..." % revision
options.stdout.write('Attempting rebase onto %s...\n' % revision)
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
if verbose:
if options.verbose:
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
print "\n%s" % e.stderr.strip()
options.stdout.write('\n%s\n' % e.stderr.strip())
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
print e.stdout.strip() print "Rebase produced error output:\n%s" % e.stderr.strip()
options.stdout.write(e.stdout.strip() + '\n') options.stdout.write('Rebase produced error output:\n%s\n' % e.stderr.strip())
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
print "Rebase produced error output:\n%s" % rebase_err.strip() if not verbose:
options.stdout.write('Rebase produced error output:\n%s\n' % rebase_err.strip()) if not options.verbose:
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
print ""
options.stdout.write('\n')
def _AttemptRebase(self, upstream, files, verbose=False, newbase=None, branch=None, printed_path=False): """Attempt to rebase onto either upstream or, if specified, newbase.""" files.extend(self._Run(['diff', upstream, '--name-only']).split()) revision = upstream if newbase: revision = newbase if not printed_path: prin...
def _CheckDetachedHead(self, rev_str):
def _CheckDetachedHead(self, rev_str, options):
def _CheckDetachedHead(self, rev_str): # HEAD is detached. Make sure it is safe to move away from (i.e., it is # reference by a commit). If not, error out -- most likely a rebase is # in progress, try to detect so we can give a better error. try: _, _ = scm.GIT.Capture( ['name-rev', '--no-undefined', 'HEAD'], self.chec...
print ("\n_____ found an unreferenced commit and saved it as '%s'" % name)
options.stdout.write( '\n_____ found an unreferenced commit and saved it as \'%s\'\n' % name)
def _CheckDetachedHead(self, rev_str): # HEAD is detached. Make sure it is safe to move away from (i.e., it is # reference by a commit). If not, error out -- most likely a rebase is # in progress, try to detect so we can give a better error. try: _, _ = scm.GIT.Capture( ['name-rev', '--no-undefined', 'HEAD'], self.chec...
filterer = DiffFilterer(self.relpath)
filterer = DiffFilterer(self.relpath, options.stdout)
def pack(self, options, args, file_list): """Generates a patch file which can be applied to the root of the repository.""" path = os.path.join(self._root_dir, self.relpath) if not os.path.isdir(path): raise gclient_utils.Error('Directory %s is not present.' % path) command = ['svn', 'diff', '-x', '--ignore-eol-style'] ...
print("________ found .git directory; skipping %s" % self.relpath)
options.stdout.write('________ found .git directory; skipping %s\n' % self.relpath)
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
print('\n_____ relocating %s to a new checkout' % self.relpath)
options.stdout.write('\n_____ relocating %s to a new checkout\n' % self.relpath)
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
print('\n_____ switching %s to a new checkout' % self.relpath)
options.stdout.write('\n_____ switching %s to a new checkout\n' % self.relpath)
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
print('\n_____ %s%s' % (self.relpath, rev_str))
options.stdout.write('\n_____ %s%s\n' % (self.relpath, rev_str))
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
print("\n_____ %s is missing, synching instead" % self.relpath)
options.stdout.write('\n_____ %s is missing, synching instead\n' % self.relpath)
def revert(self, options, args, file_list): """Reverts local modifications. Subversion specific.
print(file_path)
options.stdout.write(file_path + '\n')
def revert(self, options, args, file_list): """Reverts local modifications. Subversion specific.
print("\n________ couldn't run \'%s\' in \'%s\':\nThe directory " "does not exist." % (' '.join(command), path))
options.stdout.write( ('\n________ couldn\'t run \'%s\' in \'%s\':\nThe directory ' 'does not exist.') % (' '.join(command), path))
def status(self, options, args, file_list): """Display status information.""" path = os.path.join(self._root_dir, self.relpath) command = ['status'] + args if not os.path.isdir(path): # svn status won't work if the directory doesn't exist. print("\n________ couldn't run \'%s\' in \'%s\':\nThe directory " "does not exis...
command = ['diff']
command = ['diff', '-x', '--ignore-eol-style']
def pack(self, options, args, file_list): """Generates a patch file which can be applied to the root of the repository.""" path = os.path.join(self._root_dir, self.relpath) if not os.path.isdir(path): raise gclient_utils.Error('Directory %s is not present.' % path) command = ['diff'] command.extend(args)
if not content_array[0].startswith('svn: File not found:'): continue
if (content_array[0].startswith('svn: File not found:') or content_array[0].endswith('path not found')): break
def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same...
help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms")
help="override deps for the specified (comma-separated) " "platform(s); 'all' will process all deps_os " "references")
def CMDstatus(parser, args): """Show modification status for every dependencies.""" parser.add_option("--deps", dest="deps_os", metavar="OS_LIST", help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms") (options, args) = parser.parse_args(args) client = GClient.LoadCurrentCon...
help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms")
help="override deps for the specified (comma-separated) " "platform(s); 'all' will process all deps_os " "references")
def CMDsync(parser, args): """Checkout/update all modules.""" parser.add_option("--force", action="store_true", help="force update even for unchanged modules") parser.add_option("--nohooks", action="store_true", help="don't run hooks after the update is complete") parser.add_option("-r", "--revision", action="append", ...
help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms")
help="override deps for the specified (comma-separated) " "platform(s); 'all' will process all deps_os " "references")
def CMDrevert(parser, args): """Revert all modifications in every dependencies.""" parser.add_option("--deps", dest="deps_os", metavar="OS_LIST", help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms") parser.add_option("--nohooks", action="store_true", help="don't run hooks ...
help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms")
help="override deps for the specified (comma-separated) " "platform(s); 'all' will process all deps_os " "references")
def CMDrunhooks(parser, args): """Runs hooks for files that have been modified in the local working copy.""" parser.add_option("--deps", dest="deps_os", metavar="OS_LIST", help="sync deps for the specified (comma-separated) " "platform(s); 'all' will sync all platforms") parser.add_option("--force", action="store_true"...
options.deps_os = None
def CMDrevinfo(parser, args): """Outputs details for every dependencies.""" parser.add_option("--snapshot", action="store_true", help="create a snapshot file of the current " "version of all repositories") (options, args) = parser.parse_args(args) client = GClient.LoadCurrentConfig(options) options.deps_os = None if no...
elif os.path.isfile(file_path):
elif os.path.isfile(file_path) or os.path.islink(file_path):
def revert(self, options, args, file_list): """Reverts local modifications. Subversion specific.
entries = {} entries_deps_content = {}
def PrintRevInfo(self): """Output revision info mapping for the client and its dependencies. This allows the capture of an overall "revision" for the source tree that can be used to reproduce the same tree in the future. The actual output contains enough information (source paths, svn server urls and revisions) that it...
if name in entries:
if name in solution_names:
def GetURLAndRev(name, original_url): url, revision = gclient_utils.SplitUrlRevision(original_url) if not revision: if revision_overrides.has_key(name): return (url, revision_overrides[name]) else: scm = gclient_scm.CreateSCM(solution["url"], self._root_dir, name) return (url, scm.revinfo(self._options, [], None)) else...
deps = self._ParseAllDeps(entries, entries_deps_content) deps_to_process = deps.keys() deps_to_process.sort() for d in deps_to_process: if type(deps[d]) == str: (url, rev) = GetURLAndRev(d, deps[d]) entries[d] = "%s@%s" % (url, rev) for d in deps_to_process: if type(deps[d]) != str: deps_parent_url = entries[deps[d...
deps = self._ParseAllDeps(entries, entries_deps_content) deps_to_process = deps.keys() deps_to_process.sort() for d in deps_to_process: if type(deps[d]) == str: (url, rev) = GetURLAndRev(d, deps[d]) entries[d] = "%s@%s" % (url, rev) for d in deps_to_process: if type(deps[d]) != str: deps_parent_url = entries[deps[d...
def GetURLAndRev(name, original_url): url, revision = gclient_utils.SplitUrlRevision(original_url) if not revision: if revision_overrides.has_key(name): return (url, revision_overrides[name]) else: scm = gclient_scm.CreateSCM(solution["url"], self._root_dir, name) return (url, scm.revinfo(self._options, [], None)) else...
options.entries_filename = ".gclient_entries"
if options.gclientfile: options.config_filename = options.gclientfile options.entries_filename = options.config_filename + "_entries"
def Main(argv): """Parse command line arguments and dispatch command.""" option_parser = optparse.OptionParser(usage=DEFAULT_USAGE_TEXT, version=__version__) option_parser.disable_interspersed_args() option_parser.add_option("", "--force", action="store_true", default=False, help=("(update/sync only) force update even...
except gclient_utils.CheckCallError:
except gclient_utils.CheckCallError, e:
def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.
f = open("drover.properties") exec(f) f.close()
FILE_PATTERN = file_pattern_ execfile("drover.properties")
def drover(options, args): revision = options.revert or options.merge # Initialize some variables used below. They can be overwritten by # the drover.properties file. BASE_URL = "svn://svn.chromium.org/chrome" TRUNK_URL = BASE_URL + "/trunk/src" BRANCH_URL = BASE_URL + "/branches/$branch/src" SKIP_CHECK_WORKING = True...
dir_info = SVN.CaptureInfo(".") repo_root = dir_info["Repository Root"]
dir_info = SVN.CaptureInfo('.') repo_root = dir_info['Repository Root']
def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same...
url_path = dir_info["URL"]
url_path = dir_info['URL']
def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same...
content = ""
content = None
def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same...
svn_path = url_path + "/" + filename
svn_path = url_path + '/' + filename
def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same...
gclient_utils.FileWrite(cached_file, content)
if content is not None or filename != CODEREVIEW_SETTINGS_FILE: gclient_utils.FileWrite(cached_file, content or '')
def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): """Retrieves a file from the repository and caches it in GetCacheDir() for max_age seconds. use_root: If False, look up the arborescence for the first match, otherwise go directory to the root repository. Note: The cache will be inconsistent if the same...
socket.getfqdn().endswith('.google.com')):
socket.getfqdn().endswith('.google.com') and not 'NO_BREAKPAD' in os.environ):
def Register(): """Registers the callback at exit. Calling it multiple times is no-op.""" global _REGISTERED if _REGISTERED: return _REGISTERED = True atexit.register(CheckForException)
'and retry or visit go/isgaeup.\n%s') % (e.code, e.reason)
'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
def main(argv): if not argv: argv = ['help'] command = Command(argv[0]) # Help can be run from anywhere. if command == CMDhelp: return command(argv[1:]) try: GetRepositoryRoot() except gclient_utils.Error: print >> sys.stderr, 'To use gcl, you need to be in a subversion checkout.' return 1 # Create the directories wh...
if (filter(lambda x: '502 Bad Gateway' in x, failure) or (len(failure) and len(file_list) > previous_list_len)): if args[0] == 'checkout':
if args[0] == 'checkout': if len(file_list) == previous_list_len: for x in failure: if ('502 Bad Gateway' in x or 'svn: REPORT of \'/svn/!svn/vcc/default\': 200 OK' in x): if os.path.isdir(args[2]): chromium_utils.RemoveDirectory(args[2]) break else: raise else:
def CaptureMatchingLines(line): match = compiled_pattern.search(line) if match: file_list.append(match.group(1)) if line.startswith('svn: '): failure.append(line)
print "Sleeping 15 seconds and retrying...." time.sleep(15) continue raise
else: if len(file_list) == previous_list_len: for x in failure: if ('502 Bad Gateway' in x or 'svn: REPORT of \'/svn/!svn/vcc/default\': 200 OK' in x): break else: raise else: pass print "Sleeping 15 seconds and retrying...." time.sleep(15) continue
def CaptureMatchingLines(line): match = compiled_pattern.search(line) if match: file_list.append(match.group(1)) if line.startswith('svn: '): failure.append(line)
self._long_text.encode('ascii', 'replace'))
long_text)
def _Handle(self, output_stream, input_stream, may_prompt=True): """Writes this result to the output stream.
if issue == "None":
try: description = gcl.GetIssueDescription(int(issue)) except ValueError:
def __init__(self, commit=None, upstream_branch=None): self.commit = commit self.verbose = None self.default_presubmit = None self.may_prompt = None
else: description = gcl.GetIssueDescription(int(issue))
def __init__(self, commit=None, upstream_branch=None): self.commit = commit self.verbose = None self.default_presubmit = None self.may_prompt = None
failure.append(True)
failure.append(line)
def CaptureMatchingLines(line): match = compiled_pattern.search(line) if match: file_list.append(match.group(1)) if line.startswith('svn: '): # We can't raise an exception. We can't alias a variable. Use a cheap # way. failure.append(True)
print 'Do you want to send a crash report [y/N]? ', if sys.stdin.read(1).lower() != 'y': return
def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'): print 'Do you want to send a crash report [y/N]? ', if sys.stdin.read(1).lower() != 'y': return print 'Sending crash report ...' try: params = { 'args': sys.argv, 'stack': stack, 'user': getpass.getuser(), } request = urllib.urlopen(url, urllib.ur...
if in_byte == '\n' and filter_fn: filter_fn(in_line)
if in_byte == '\n': if filter_fn: filter_fn(in_line)
def SubprocessCallAndFilter(command, in_directory, print_messages, print_stdout, fail_status=None, filter_fn=None): """Runs command, a list, in directory in_directory. If print_messages is true, a message indicating what is being done is printed to stdout. If print_messages is false, the message is printed only if we ...
root, entries = gclient_utils.GetGClientRootAndEntries()
root_and_entries = gclient_utils.GetGClientRootAndEntries() if not root_and_entries: print >> sys.stderr, ( 'You need to run gclient sync at least once to use \'recurse\'.\n' 'This is because .gclient_entries needs to exist and be up to date.') return 1 root, entries = root_and_entries
def CMDrecurse(parser, args): """Operates on all the entries. Runs a shell command on all entries. """ # Stop parsing at the first non-arg so that these go through to the command parser.disable_interspersed_args() parser.add_option('-s', '--scm', action='append', default=[], help='choose scm types to operate upon') op...
data = [("description", self.description),]
xsrf_token = self.SendToRietveld( '/xsrf_token', extra_headers={'X-Requesting-XSRF-Token': '1'}) data = [("description", self.description), ("xsrf_token", xsrf_token)]
def CloseIssue(self): """Closes the Rietveld issue for this changelist.""" data = [("description", self.description),] ctype, body = upload.EncodeMultipartFormData(data, []) self.SendToRietveld('/%d/close' % self.issue, body, ctype)