Lines Matching full:patch
37 """ Extract the list of modified paths from the patch file. """
57 This utility updates existing patch files.
81 help='resave existing patch files to pick up manual changes')
87 help='reapply the patch without first reverting changes')
93 help='revert all changes from existing patch files')
106 'changed the patch file will be resaved. Used in combination with --reapply.')
108 '--patch',
110 dest='patch',
113 help='optional patch name to process (multiples allowed)')
121 'combination with --resave and a single --patch value.')
129 if len(options.add) > 0 and (len(options.patch) != 1 or not options.resave):
130 print('--add can only be used with --resave and a single --patch value.')
142 patch_dir = os.path.join(cef_dir, 'patch')
143 patch_cfg = os.path.join(patch_dir, 'patch.cfg')
147 # Read the patch configuration file.
148 msg('Reading patch config %s' % patch_cfg)
155 # Read each individual patch file.
157 for patch in patches:
158 # If specific patch names are specified only process those patches.
159 if options.patch and not patch['name'] in options.patch:
163 patch_file = os.path.join(patches_dir, patch['name'] + '.patch')
166 msg('Reading patch file %s' % patch_file)
167 if 'path' in patch:
168 patch_root_abs = os.path.abspath(os.path.join(src_dir, patch['path']))
172 # Retrieve the list of paths modified by the patch file.
175 # List of paths added by the patch file.
183 # Revert any changes to existing files in the patch.
212 # line endings. This will cause the patch tool to fail when attempting
213 # to patch those files on Posix systems. Convert any such files to Posix
214 # line endings before applying the patch.
229 # Apply the patch file.
230 msg('Applying patch to %s' % patch_root_abs)
232 result = exec_cmd('patch -p0', patch_root_abs, patch_string)
236 # correct if/when the patch file is re-saved.
246 raise Exception('Failed to apply patch file: %s' % result['err'])
254 patch['name'])
255 failed_patches[patch['name']] = failed_lines
278 # Add additional requested files to the patch.
290 # Inform git of the added paths so they appear in the patch file.
296 # Re-create the patch file.
301 raise Exception('Failed to create patch file: %s' % result['err'])
304 # Patch files should always be saved with Posix line endings.
305 # This will avoid problems when attempting to re-apply the patch
314 raise Exception('Patch file does not exist: %s' % patch_file)